It is implemented in the form of «XSDDoc» template set for FlexDoc/XML.
'templates/XSDDoc/'
subdirectory of FlexDoc/XML
archive or installation.
It is ready to use. Please read Getting Started!
Here you can see some samples of such a documentation (click on a screenshot to view the real HTML):
![]() |
![]() |
The following functionality is supported:
These screenshots show pages of a demo RTF documentation (click to enlarge):
![]() |
![]() |
![]() |
The following features/functionality are supported:
[page number]
Although RTF is incompatible with HTML, all of the specified HTML/XHTML markup will be rendered with the appropriate formatting features of RTF (including lists, tables and insertion of images).
<xs:import>
,
<xs:include>
,
<xs:redefine>
elements found across all involved XSD files.
You just need to specify only the root XSD files of your project. Everything referenced from them will be loaded automatically!
When you design a schema, you definitely use some of those design patterns, even when you haven't heard of them. Simply, in that case you reinvent the pattern by yourself. When a schema is generated by some tool, it always follows a certain pattern.
So, how do all those design patterns differ from one another in respect of documenting them? Or asking it otherwise, what might be common? If you look closely into this, you could notice that all XML schema design patterns come down to a few specifics, all of which can be addressed by a single documentation approach:
Design Pattern Specific | How It's Handled |
---|---|
The entire XML schema is broken into a number of XSD files, some of which import/include others. |
You don't need to do anything special about this.
Both <xs:import> and <xs:include> XSD elements
are supported. All referenced schemas will be automatically loaded and documented.
Moreover, using template parameters: you can even specifically disable documenting of imported/included schemas (even though they will be processed still). |
There are several XSD files and some of them redefine certain components declared within others. |
That is done using <xs:redefine> XSD elements, which are processed/documented by XSDDoc very well!
See Also: Documenting of redefinitions |
Some elements are declared locally. Such elements may share the same name, yet have different content models. Others may be absolutely identical (with equal names and based on the same global type), yet declared separately in numerous locations. |
If you document all of that straight (which is actually what all other known to us XML schema doc-generators always do!),
in certain cases you may get in your XML schema documentation a mess made of numerous repeating local element names,
in which it could be difficult to find some useful information.
XSDDoc provides two ways of dealing with that problem: |
Locally declared elements are used everywhere instead of attributes to hold simple data. | Again, if you document it straight, various navigation lists and element summaries will get overwhelmed by insignificant local elements, in which you may have trouble to find what you need. XSDDoc provides a remedy to deal with this too, by documenting local elements in two ways: globally and locally. |
There are groups of globally declared elements referenced across the schema via few abstract elements representing any element in a group. |
Such groups of elements, called substitution groups, are specifically recognized and processed/documented by XSDDoc. See Also: Documenting of substitution groups |
The order in which elements/attributes are declared is important. | Using the following template parameters you can preserve the original ordering of your elements/attributes at various locations of the documentation: |
XML schema declares a possible root XML element that needs to be highlighted in the documentation. |
In general, the W3C XML schema specification
provides no functionality to assign which of the XML elements declared in XML schema must be
the root of any XML document that complies with that schema.
However, in many concrete situations, such an intention very much exists and needs to be documented somehow.
To solve that problem, we have introduced a concept of top-level elements.
Top-level element is the one, which satisfies the following conditions:
Typically, very few such elements can be found in an XML schema (possibly one or two per a namespace).
Using this template parameter:
you can separate the top-level elements and thereby highlight what you intended
to be the main element in your schema (e.g.
<xs:schema> in
XML schema for XML schemas).
If the separation of top-level elements doesn't work for you, alternatively, you can declare the root element the first in your XML schema. Further, when you generate documentation for that XML schema, unselect the template parameter: That will preserve the original order of element declarations in the documentation.If your XML schema is broken into several XSD files, specify the one of them that contains the root element declaration to be processed the first by the generator and unselect the parameter: That will ensure that the root element gets on the top of various navigation lists and summaries, which will highlight its special role. |
Since the version 2.6.0, XSDDoc is able to document correctly any number of conflicting XML schemas!
<xs:import>
, <xs:include>
and
<xs:redefine>
.
Note that any conflicting schemas, if they are correct indeed, cannot reference to each other (both directly and indirectly)!
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
{xsddoc}/schemas/XMLSchema_xsd/
{xsddoc}/schemas/XMLSchema_xsd_1/
![]() |
![]() |
![]() |
![]() |
The last two screenshots show pages of the RTF documentation generated by that schema (click to enlarge). Here, you can also download a PDF converted from that RTF: HumanEvolution.pdf
See Also:
See Also:
Frame | Usage | |
---|---|---|
Overview Frame | The primary navigation frame. Here you select some large-scale scope, e.g. a namespace or an XML schema. | These are navigation frames, where you can quickly find what you need without disturbing the current view of the detail document. |
List Frame | Used to display one of the second-level navigation lists associated with a particular selection in «Overview Frame». Here you select a particular XSD component within the selected scope. | |
Detail Frame | Shows the details of the selected item (e.g. namespace, XML schema or component). Related template parameters: Navigation | Detail Frame | This frame is used to display the actual documentation content |
See Also: Framed HTML Documentation
Using it, it is possible to generate such things as shown on the left screenshot (click to enlarge).
You may think: What's special here? Just yet another page of some documentation... But it uses three grid layouts! If that technique was not applied, the information printed on that page would occupy 2-3 pages instead!
Cross-links are produced by matching sets of special keys generated for both link source and destination. The keys represent actual data being linked. Their generation is specified in templates along with the generation of the corresponding pieces of output. In that way anything can be cross-linked together. At that, if a particular set of keys cannot be matched, an alternative set of keys can be specified as well. That means, when the primary target is absent, the link can go to some alternative location related to the link source.
For instance, when in a reproduced XML source the value of some attribute is the name of some XSD component, that value is linked to the component detail. But when the detail is absent, the link can go to a corresponding item in some component summary:In RTF documentation intended for printing, some cross-links can be emulated with page number references that appear in square brackets after the linked item, as visible in the above screenshot.
See Also: FlexDoc/XML | Features | Hypertext | Cross-Reference Links
Problem | Description/Solution |
---|---|
Locally declared elements are used everywhere instead of attributes to hold simple data. | Documenting them straight (together with global elements and local element with complex content) may result in that various navigation lists and summaries get overwhelmed by insignificant items. That may greatly reduce the clarity of the documentation and impede its navigation. |
There are many element declarations with the same name but based on different types. |
Since the introduction of local elements in W3C XML Schema language, there is no strict relationship
between the element name and its type for the entire scope of the XML document.
Now, within the same XML document, you may find several different XML elements that although share the same name,
actually represent more or less different things and, therefore, may have different attributes and content.
It is clear that such equally named but essentially different local elements must be documented separately.
Solution: Adding extensions to local element names |
Certain local elements share the same name and the same global type, yet are declared separately in numerous locations. |
In many cases local elements are declared very simply:
Solution: Unifying local elements by type |
The purpose of two types of the documentation is that some elements may be important to show in the navigation lists, whereas other elements (particularly those with predefined simple content that essentially play the role of attributes) are better to be documented locally where they are defined/used. Exposing such insignificant elements in the navigation lists and summaries (along with the global elements or those with complex content) may blow out and overwhelm such lists and make them difficult to navigate.
As an example, here are two documentations generated for the same little XML schema (from “Sales Report” sample).
On the left screenshot is the XML schema documentation with all elements (both global and local) documented separately (globally). Click on the screenshot to view the doc.
On the left screenshot is the XML schema documentation, in which only global elements and local elements with complex type are documented separately. All local elements with simple content are documented locally. Such a documentation may appear tidier and easier to navigate. Click on the screenshot to view it.
Related Template Parameters:
On the screenshot (left) you can see how element name extensions look (the grey text).
Related parameter: Show | Element Name Extensions
You've got lots of local element components that define effectively the same thing. So, instead of flooding the documentation with repeating element names, why not to document all those local elements (with the same global type) as a single one? We shall call it unified local element and its name extension (when necessary) will be just the name of that global type.
Here's how it works:
![]() |
![]() |
Related parameter: Generate Details | Elements | Local Elements | Unify By Type
Here is an example of such a list (click on the screenshot to see it within the documentation).
Related parameter: Details | Component Documentation | Lists Of Related Components | Containing Elements
<xs:redefine>
element, during which some components defined in the included schema may be replaced with equally named components however defined differently (redefined)
within the <xs:redefine>
element. Those redefinitions are typically derived from the previous versions of the same components.
A component may be redefined any number of times (in different XML schemas calling one another through <xs:redefine>
elements).
Each redefinition creates a new version of the component. XSDDoc documents all such versions (including the initial one). To distinguish them,
an extension is added to the component name showing the component version.
On the following composite screenshot you can see a 'family'
element group redefined two times (all three versions in the same list on the left
and the diagram of the last version on the right):
substitutionGroup
attribute.
XSDDoc recognizes substitution groups and documents them both in the documentation (as member list, list of possible parents by substitution and so on) and on the diagrams (as a special branch with group member elements attached to the group head).
On the screenshot (left) you can see the XML schema documentation, generated by an XML schema with heavy use of substitution groups. Click on the screenshot to view it.
The diagram provides:
<xs:sequence>
, <xs:choice>
, <xs:all>
)
and all model groups involved in building of that content model.
The following screenshots are two diagrams of the same XSD component. On the left is the diagram with the element/attribute properties. On the right is the diagram without the properties. Click on the screenshots to see each diagram in full size within the corresponding documentation:
![]() |
![]() |
Element Content Models are represented using Kleene operators (the same as used in XML DTD) extended with two more operators to cover all situations allowed by W3C XML Schemas. The following table shows all operators used in Element Content Model representations:
Operator | Description |
---|---|
, | sequence |
| | choice |
() | grouping |
? | 0 or 1 times |
+ | 1 or more times |
* | 0 or more times |
Extended operators | |
× |
The idea of this operator can be expressed by the formula:
|
[n1, n2] |
General cardinality operator (n1 can be 0 or any number; n2 is any number or *).
It is used in those rare situations when Kleene cardinality operators (?, +, *) are not enough. For example:
|
Related template parameters: Details | Component Documentation | XML Representation Summary
![]() |
![]() |
That XML source is actually reproduced from the DOM representation of the schema file. However, it closely follows the original one enriched with the following features:
<xs:annotation>
elements (which is controlled by “... | XML Source | Remove Annotations” parameters).
Here is how the initial XML source fragment (above on the right) looks after removing its annotations:
You may want to suppress <xs:annotation>
elements in the reproduced XML source when you use XHTML to format your annotations, because the XHTML markup elements may occupy
too much space (so they will overwhelm anything else).
On the other hand, to avoid overwhelming the user with too many unimportant settings, many template parameters inherit or derive their default values from other top-level parameters. So, you actually need to change only a few of them. The entire parameter set is organized in a tree, which makes it easier to understand and navigate. That tree is displayed in the Parameter Inspector as shown below.
See Also: FlexDoc/XML | Features | Template-driven architecture | Template Parameters
XSDDoc is controlled by more than 400 parameters, which you can specify in Parameter Inspector invoked from the generator GUI (when you click «Params» button with one of the main templates selected):
Alternatively, you can specify any template parameters through Java command line using -p option.
See Also:
Generator options are separated from templates. They do not depend on the selected template as well as their settings are not used in templates at all. That's because templates are designed to be mostly independent of the particular output format. Only some general assumptions about the output format are accounted, for instance, whether it supports pagination and has page numbers.
Which particular generator options are available depends on the selected output format, which currently may be HTML, RTF and TXT (plain text). In the generator GUI, after you have selected the destination output format, you can click «Options» button, which will invoke Format Option Inspector. Here you can see all options available for the given format and specify them. This screenshot shows the HTML Option Inspector:
Alternatively, you can specify any generator options (along with template parameters) through Java command line using -o option.
See Also:
![]() |
![]() |
{flexdoc-xml}/templates/XSDDoc/css/azure-theme.css
How to specify it is shown in the HTML Option Inspector screenshot above. You should set:
Note that the possibility to use any CSS stylesheets is available only under the “FlexDoc/XML SDK” license (which covers the Template Designer).
See Also:
Template Designer is a highly sophisticated GUI used to design/edit templates.
It represents the template both in the form template components,
which it is made of, and the output those components would generate.
This screenshot shows XSDDoc/lib/element/contentElements.tpl
template open in the Template Designer (click on the screenshot to see in full size).
That template generates the Content Element Detail section of Component Documentation.
Template Designer is covered by the separate “FlexDoc/XML SDK” license, which you need to acquire along with “FlexDoc/XML XSDDoc” license, if you want to modify XSDDoc templates.
See Also:
By default, everything will work in demo mode. You will be able to generate a reduced documentation (including diagrams) by any your input XSD files. If they are small enough, that will be actually the complete documentation, which you can use for free! For further details, see Licensing.
{flexdoc-xml}/integrations/ant/
{flexdoc-xml}/integrations/maven/
{flexdoc-xml}/DiagramKit/ant/
{flexdoc-xml}/DiagramKit/maven/
By default, everything will work in demo mode. It means that all your input XSD files will be fully processed, however fully documented will be only limited number of components. Component diagrams will be generated as well by any diagramming plugin you choose and as many as it's allowed by XSDDoc demo limits. What exactly the demo limits are depends on a particular main template (as well as some metrics).
If those limits are not reached, you will get the complete documentation. Otherwise, some content will be omitted and the message included saying which limits were exceeded. Anyway, the result documentation will be minimally distorted, to allow you to evaluate how everything will look under the full license. Any documentation generated in demo mode is yours. You may use it for free as you wish.
Template Designer will work in demo mode as well. You will be able to run it, investigate some functionality, but unable to save any created/modified templates.
See Also:
But there will be some limitations:
Then, you will be redirected to Try | Trial License page with “FlexDoc/XML” preselected in the «Product» field.
'flexdoc-xml.license'
file, which you will receive by email.
'lib'
directory (near 'flexdoc-xml.jar'
file):
{flexdoc-xml}/lib/
where '{flexdoc-xml}'
denotes your FlexDoc/XML installation directory.
See Also:
License | Description |
---|---|
FlexDoc/XML XSDDoc |
Unlocks all functionality implemented in XSDDoc templates.
In particular, you will be able to:
|
FlexDoc/XML DiagramKit | Unlocks all functionality implemented in DiagramKit. Allows you to generate XSD diagrams and automatically insert them into documentation generated by XSDDoc (with the support of all possible diagram hyperlinks). |
FlexDoc/XML SDK |
You need this license if you want to heavily customize the generated documentation (e.g. change some colors, fonts, layouts, look & feel, add new functionality etc).
In particular, this license covers:
Please note that neither commercial template applications themselves (e.g. XSDDoc) nor diagramming plugins are covered by this license! |
See Also:
Your goal | The license(s) you need |
---|---|
You can order any combination of those licenses starting from Order page.