XSD2HTMLGraph

Generator of Presentation of XML Schema

Purpose

XSD2HTMLGraph creates an HTML page that shows graphically how to fill an XML file that conforms to a given XML Schema. This is a simplified view of the schema as the intention is not to document the way the schema is built. XSD2HTMLGraph allows a user to quickly understand a schema he has to build an instance from. This tool is important in that process because XML schemas are difficult to be read directly by human (it's no so easy by program either!).

The generated graph presents the data model described by the schema by showing the following items of the target XML files:

The following items are intentionally not part of the result because they are considered schema design information:

Refer to Limitations for the items that should be part of the graph but are not (yet?) available.

Parts of the generated graph can be fold to simplify the graph representation and get an overview of the main elements. Fold parts can be later unfold to dig in the details.

Implementation

XSD2HTMLGraph is provided as an XSLT 2 stylesheet that specifies the transformation of the XSD schema file into the HTML graph page. Therefore it requires a XSLT 2 processor that is not provided here. It can be for example one in the list below or any conformant XSLT 2 processor:

SAXON
Multi-platform (Java program)
home edition is open source
Command line: java -cp saxon.jar net.sf.saxon.Transform -o result-graph.html input-schema.xsd XSD2HTMLGraph.xsl
AltovaXML
Platform: Win32
Community edition downloadable and usable at no cost
Command line: AltovaXML -xslt2 XSD2HTMLGraph.xsl -in input-schema.xsd -out result-graph.html

XSD2HTMLGraph is not compatible with XSLT 1 processor. Though XSLT 1 is in theory a Turing machine, it lacks some basic capabilities to allow implementing XSD2HTMLGraph in a reasonnably complex manner (without having to convert back and forth node sets reference to strings). Though the use of some EXSLT extensions should allow a porting to XSLT 1. This would allow to implement XSD2HTMLGraph online with the XSLT parser of PHP5.

Screen Capture

The image below shows the top of the result of XSD2HTMLGraph applied to the Example.xsd schema rendered by Firefox. You can also browse the actual result page.

Screen capture of the beginning of the generated HTML pages

Known Limitations

License

GNU General Public License, version 3 (GPLv3)

Copyright and Disclaimer

Copyright (C) 2010 Philippe Chevrier

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.