DocFlex/XML - XSDDoc - XML Schema Documentation Generator

  1. What is DocFlex/XML XSDDoc?
  2. What you can generate with it
  3. What XML Schemas you can document
  4. XML Schema Documentation
  5. How Documentation Generator Works
  6. Running Documentation Generator
  7. Integrations
  8. How To Get Started
  9. What you need to license

1.  What is DocFlex/XML XSDDoc?

“DocFlex/XML XSDDoc” is a template application (template set) of DocFlex/XML that implements a very powerful XML Schema Documentation Generator in HTML and RTF output formats with the possibility of automatic inclusion of XSD diagrams generated by either Altova XMLSpy or Oxygen XML Editor.

DocFlex/XML is a software system for development and execution of high quality documentation and report generators from any data stored in XML files. For more details, please see: What is DocFlex/XML?

The XSDDoc template set is found in 'templates/XSDDoc/' subdirectory of DocFlex/XML archive. It is immediately ready to use. Just read How To Get Started!

2.  What you can generate with it

Using XSDDoc templates set, you can generate the following types of output/documentation:

HTML Output

Framed HTML Documentation

Multi-framed HTML (Javadoc-like) XML schema documentation can be generated with FramedDoc.tpl main template by any number of W3C XML Schema definition (XSD) files.

This kind of documentation may be useful for both the XML schema authors (e.g. to publish the XML schema project on the web) and those who simply need to understand particular large XML schemas.

The framed HTML documentation provides most detailed and easy accessible information about all the XML schema components and interconnections between them.

These screenshots show such a documentation (click on a screenshot to view the real HTML):

Please, look also at XSDDoc | Examples page to view/download other demo HTML documentations generated from various large XML schemas found on Internet.

Single File HTML Documentation

The same entire documentation (above) can be equally generated as a single HTML file using PlainDoc.tpl main template. Click on the screenshot to see it:

RTF Output

RTF Documentation

Using PlainDoc.tpl main template, it is possible not only to generate a single file HTML. Simply, by switch the generator output format to “RTF”, the same template will produce a highest quality RTF file!

Similar to HTML, the RTF documentation may be also interconnected with hyperlinks. In addition, many hyperlinks are duplicated with page number references, which may greatly help to use/navigate such documentation in a printed form.

On the following screenshots, you can see pages of an RTF documentation generated by the same “XML Schema for XML Schemas” (click to enlarge):

See also Examples | RTF Documentation for more details about that demo RTF and other screenshots.

PDF Documentation

Using some RTF to PDF converter software (e.g. Adobe Acrobat PDFMaker), you can also produce a top quality PDF documentation from the RTF output generated with the PlainDoc.tpl main template.

Here is an example of the XML schema documentation in PDF format generated in that way (click on the screenshot to see/download the PDF file, 2.6 MB):

Such documentation can be used both for printing and publishing on the web.

3.  What XML Schemas you can document

Any XML schema projects

This XML schema documentation generator was designed to document any XML schema projects imaginable (see also below). The following features are most important for this:

Any XML schema size and number of components

Processing and documenting (correctly and reliably!) huge XML schemas containing thousands of components. Just look at some XML schema docs generated by our customers: This is real world stuff!

Support of any XML schema design patterns

Like a single XML schema describes the structure of infinite number of XML files, the structure of the same XML file could be described by a great (potentially infinite) number of XML schemas. All of those XML schemas would differ from each other by ways of how they are designed. Those ways are called “XML schema design patterns”. Some of them were given even special names: chameleon, russian doll, salami slice, venetian blind, etc.

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:

Joint documenting of conflicting XML schemas

Conflicting XML schemas are those that define the same components (that is with the same local name in the same namespace). For instance, different versions of some your XML schema project will likely contain conflicting XML schemas.

Straight documenting of several conflicting XML schemas together will likely produce incorrect documentation. Some links from the references to global components defined simultaneously in different schemas would go to wrong locations. What's more, the content models of some components (as well as other things) may be derived incorrectly. As a result, the whole such a documentation may be almost unusable. Yet, those conflicting schemas themselves may be quite correct at that!

Since the version 2.6.0, XSDDoc is able to document correctly any number of conflicting XML schemas!

In short, this works as follows:

  1. Among all XML schemas initially specified for documenting, the main schemas are identified. These are the schemas that are not referenced from other schemas.

    Here, schema reference is any of the elements: <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)!

  2. The main schemas break everything into several domains adding to each name a sort extra “namespace”. This allows resolving global component references only within a particular main schema domain, which the given reference belongs to.
  3. Some XML schemas involved here may be those referenced from several conflicting schemas simultaneously. These must be some library schemas valid in all cases. For instance:
    <xs:import namespace="" schemaLocation=""/>
    Such schemas will belong to all domains at once. They will be documented only once. All links to the components defined in them will go to the same documentation locations from anywhere those components are used.
  4. In the case of multi-file framed HTML documentation, if the names of conflicting XML schema files are repeating too, the components of those schemas will still be documented in separate subdirectories.

    Normally, such a subdirectory name is derived from the name of the XML schema file. If that name duplicates another schema's name, it will be extended with a numeric suffix so as to make the subdirectory unique. For example:


4.  XML Schema Documentation

Unlike various other XML schema doc-generators currently visible in Internet, which tend to produce a rather simple and obvious content not much more informative than the XML schema source itself, this XML schema doc-generator from the start was designed with a different focus.

We believe that a true XML schema documentation should allow the user to quickly find any necessary meaningful information about the XML schema, if only that information could be automatically obtained or deduced from it. (At that, everything must be accurate -- not just claimed to be there -- which in fact is not so simple to achieve!)

The following documentation features that we have worked out and supported could help to achieve that objective.

Features (How everything is documented)

This section is published on a separate page: DocFlex/XML | XSDDoc | Features. Here is its table of contents:
  1. XML Schemas
  2. Namespaces
  3. Components
  4. XML Source
  5. Annotations
  6. Simple Content
  7. Complex Content
  8. Types
  9. Global Elements
  10. Local Elements
  11. Attributes
  12. Global Groups

Organization (Documentation Structure)

This section is published on a separate page: DocFlex/XML | XSDDoc | Organization. Here is its table of contents:
  1. Main Blocks
  2. Framed HTML Documentation
  3. Single File Documentation


This section is published on a separate page: DocFlex/XML | XSDDoc | Examples. Here is its table of contents:
  1. HTML Documentation
  2. RTF Documentation
  3. Using XHTML in annotations

5.  How Documentation Generator Works

Template-Driven Architecture

This XML Schema Documentation Generator is implemented entirely as a set of XSDDoc templates using only generic capabilities of raw XML file processing supported by DocFlex/XML.

No Java code has been written anywhere specifically for the purpose of XML schema doc-generation! Neither any other XML processing technologies (e.g. XSL Transformations) are used anywhere in background!

What are Templates?

Please, see here:

Template Parameters

Since all the content and formatting of the generated documentation is programmed entirely within templates, the numerous options and switches, which normally control such things in traditional documentation generators, now simply become template parameters.

The XSDDoc templates provide great a lot of parameters (> 400), which make possible adjusting the content (and some formatting) of the generated XML Schema documentation within a huge range of details, starting from a few summaries and overviews up to the most comprehensive documentation containing every feature possible.

Template Designer

Using a visual graphic Template Designer, you can customize all “XSDDoc” templates as you need. In particular, you can easily translate any messages specified in the templates from English into your native language, insert your company logotype, change documentation design and content, extend with your own functionality and so on.

The following screenshot shows the contentElements.tpl template open in the Template Designer (click to see in full-size):

See Also: DocFlex/XML | Documentation | Designing Templates | Running Template Designer

"XSDDoc" Template Set

This section is published on a separate page: DocFlex/XML | XSDDoc | Templates. Here is its table of contents:
  1. Overview
  2. XML Type
  3. Main Templates
  4. Subtemplates
  5. Template Parameters

Generation of Diagrams

The XSD diagrams visible in all examples on this page have been actually generated not by DocFlex/XML.

However, DocFlex does support any kind of diagrams on the level of templates. Diagrams may be supplied also with hypertext imagemaps, which allow programming in templates the generation of diagram links to any parts of the documentation.

DocFlex treats diagrams as some kind of graphical representation of particular data source elements (DSM elements). Therefore, diagrams (along with the imagemaps) must come from the data source itself, via its driver. In the case of DocFlex/XML, the data source driver is basically a reader of XML files. But it can be configured with a special extension called Element Image Provider, which can generate some image representations (i.e. diagrams) for some XML elements. Those images are supplied together with the respective XML elements. So, they can be processed with templates (i.e. inserted in the output documentation).

How exactly the Element Image Provider produces the diagrams is beyond the DocFlex/XML core. It can be equally our own diagraming engine or an integration with some external system able to generate the necessary diagrams.

We do not have a diagramming engine yet. But we do have developed the integrations with several third-party XML editors able to generate the XSD diagrams. This includes:

The diagrams in the demo documentation have been generated via the integration with XMLSpy.

6.  Running Documentation Generator

Java Command Line

Please, see DocFlex/XML | Documentation | Running Generator | Launching Generator from Command Line

Generator GUI

Besides the possibility of running the generator from the command line and setting everything using command line options, DocFlex/XML also provides a little GUI that allows you to specify all the generator setting in a more user-friendly way.

Generator Dialog

When no -nodialog option is specified on the command line, the generator launches automatically the following Generator Dialog:
In the Generator Dialog, you can:

  1. Select the template (which determines what documentation you will generate).
  2. Specify the template parameters (see Parameter Inspector below).
  3. Choose the source XML files (in the case of XSDDoc, this will be XSD files).
  4. Assign one or more XML Catalogs (as an example of the XML schema that uses an XML catalog, see “XML Schemas for DITA 1.1”).
  5. Select the documentation output format.
  6. Specify the output format options (i.e. the generator settings special for that particular output format).
  7. Choose the destination folder and the main output file name for the generated documentation.
  8. Run the generator.
  9. View the generation progress.

Once you click the “Run” button, the dialog will transform itself to show the progress of the generation:

Parameter Inspector

To handle great a lot template parameters, which control XSDDoc templates, the generator provides a special GUI called Parameter Inspector.

The parameter inspector is invoked from the generator dialog by clicking “Params” button. Its content is created dynamically from the parameter definitions found in the template.

The following screenshot shows the Parameter Inspector dialog of FramedDoc.tpl template (click on the picture to see a more expanded view):

In the Parameter Inspector you can: Once you have changed some parameters and closed the inspector dialog (with “OK” button), the new values will be stored (along with the parameter names) in the generator.config file. Further, the generator will use the parameter values found in that file. The same will happen when you open the Parameter Inspector dialog next time. The template parameters, whose names match those found in the generator.config file, will be initialized with the corresponding values from that file.

The parameters are organized in groups (which may contain subgroups and so on). A group heading may also be a parameter itself.

Each parameter group may appear in expanded or collapsed state like a tree node. The group states are also saved in the generator.config file to be restored again when the inspector is invoked next time for the same templates. Using inspector popup menu, you can quickly reset all parameters in a group to their default values.

Besides the Parameter Inspector dialog, you can always set any template parameters directly on the command line using -p option.

Using generator.config

The generator.config file allows you to combine interactive and command-line features together. Using -config option, you can provide on the command line a separate generator.config file, which will be used instead of the default one. With the Parameter Inspector you may interactively prepare all parameters needed for a specific kind of documentation. The parameters will be saved in this file. Further, you can use such a generator.config for generation (instead of specifying each time all needed parameter separately on the command line).

7.  Integrations



Apache Ant You may easily run XSDDoc from your Apache Ant build project. No special plugin is required!
Apache Maven Running XSDDoc from Apache Maven is a bit more complicated. We had to develop a little “DocFlex/XML Maven Plugin” for this. Click on the link to see how to install and use it.
XMLSpy The integration with Altova XMLSpy will let you to automatically insert the graphics diagrams produced by XMLSpy into the XML schema documentation generated by XSDDoc (with full support of diagram hyperlinks).
Oxygen XML A similar integration with Oxygen XML Editor. It also inserts diagrams, however, now generated by OxygenXML.

Click on the link in the first column to see the integration details.

8.  How To Get Started

You can generate your XML Schema documentation almost immediately. Here is the detailed instruction from the very start.

Getting Started on Windows

  1. Download the DocFlex/XML archive from the downloads page.
  2. Unpack it in some directory, e.g.:


    In further explanations, we shall refer to that directory as '{docflex-xml}'.

  3. Edit generator.bat found in that directory to specify the 'JAVA_HOME' variable according to the location of Java 1.4.x - 8.x installed on your system (the latest Java version is preferable as it may be the fastest!)

    If you don't have one of those Java versions installed on your system, you can freely download and install the most recent Java Runtime Environment (JRE) version from Java Technology web-site:

  4. Run generator.bat. You will see the Generator Dialog like the one shown on this screenshot:

  5. In the “Template” field, select
  6. In the “XML File(s)” field, specify one or many XSD files from which you want to generate your XML schema documentation.

    This field must contain one or several file specifications, which may be either:
    • local file pathname or pathname pattern
    • URL (e.g.
    • Multiple file specifications must be separated with spaces.
    • When a file specification contains spaces itself, it must be enclosed in double quotes.
    • You can combine any specification types together.
    • The "pathname pattern" is an Ant-style pattern for local file pathnames. See: DocFlex/XML | Documentation | Running Generator | ... | Using file pathname patterns.
    • In case of URL, the generator will try to download such a file directly from the Internet (or elsewhere). This, however, can be redirected using an XML catalog.

  7. In the “Output format” field, select HTML or RTF format (RTF will work only with PlainDoc.tpl template!).
  8. Click “Run” button to start generator. For a very large XML schema (or, perhaps, on a slow computer), wait some time while the generator processes your schema.
  9. That's all. Enjoy the incredible quality XML Schema documentation you won't produce with anything else!

Getting Started on macOS

  • DocFlex/XML was tested on macOS Sierra (10.12)
  • For everything to work, you need to have Java installed on your Mac (so that 'java' command is available in the Terminal). You can download Java for Mac from the Oracle website:
  1. Unpack the downloaded DocFlex/XML archive at some location (e.g. on Desktop), which we shall designate as {docflex-xml}.
  2. Go to {docflex-xml}/macOS directory (open it with the Finder).

    The doc-generator (Template Processor) is launched by generator.command shell script file. To be able running it, first you need to assign it with the executable privilege as follows:

    Run the Terminal and type in it 'chmod u+x' followed by a space and the full pathname of the script file (instead of typing it, just drag generator.command from the Finder into the Terminal window). Then, press Enter. Now, you can run generator.command from the Finder just by clicking twice on it.

    When you run generator.command, the Generator Dialog should show up like on this screenshot:

  3. Anything else is the same as in case of Windows.

Getting Started on Linux

  1. Unpack the downloaded DocFlex/XML archive at some location, which we shall designate as {docflex-xml}.
  2. Go to {docflex-xml}/linux directory. The doc-generator (Template Processor) is launched by shell script file.

    Edit to specify the JAVA_HOME variable according to the location of Java 1.4.x - 8.x installed on your system. Edit also the file "Permission" properties to allow it to be executed by Linux.

    Run that You will see the Generator Dialog like shown on this screenshot:

  3. Anything else is the same as in case of Windows.

9.  What you need to license

Limited mode - Use it for free!

You can use the best quality XML schema documentation generator right now and absolutely free. Just download DocFlex/XML archive from the downloads page. No registration required! Then, follow the step described in How To Get Started.

By default, XSDDoc will work in limited mode under the Limited Free License.

This mode allows you to generate a complete framed HTML documentation (without diagrams) by any your XML schemas and use it for any purposes. There is no limitation on the number or content of the processed XML schemas!

In limited mode, however, you cannot (or may not) do the following things:

Anyway, we believe, the framed HTML XML schema documentation generated in limited mode will be OK for those who just need to understand what a particular big XML schema describes (in fact, that's exactly how we ourselves frequently use this tool). Also, some XML schema authors may still be content with the produced result.

Full functionality - Pay only for what you need!

For professional users with complex requirements and serious demands, we offer three commercial products to enhance your XML schema toolkit. Please, see: DocFlex/XML | About | Commercial Licenses

Copyright© 2017 Filigris Works. Leonid Rudy Softwareprodukte. All rights reserved.
To contact us, please visit or e-mail to: