NOTE: 21-Jul-2009: this page will be moved to http://wiki.fasterxml.com/DtdFlattenHome Real Soon Now!
DTDFlatten is a tool that allows for creating a single ("flat") DTD resulting from processing a DTD that includes multiple external parameter entities. Using such a file may be beneficial from performance reasons, or for debugging problems with parameter entity expansion in DTDs. One example of such an optimization is flattening of big standard DTDs such as DocBook DTD.
Latest version is based on Woodstox XML-processor version 3.2.9 (built 21-Jul-2009)
You can download:
- "Binary" jar file: dtd-flatten-3.2.9.jar
- Source code (which also contains sources for ValidateXML tool): wstx-tools-src-3.2.9.tar.gz
Note: to compile tools, you also need to download Woodstox (binary) jar and put it under lib/ sub-directory (matching version used to build released package is also included in Subversion repository).
Older version(s) available:
- Woodstox 3.2.1 - based dtd-flatten-3.2.1.jar (built 07-Jun-2007)
- Woodstox 2.0.3 - based dtd-flatten-2.0.3.jar (built 26-Sep-2005)
To use DTDFlatten, simply enter something like:
java -jar dtd-flatten.jar <main-dtd-file>
There are couple of configurable settings; the easiest way to view possibilities is to omit the dtd file, in which case tool displays usage information. The configuration settings allow you to selectively include or exclude parts of DTD that may not be relevant, like comments, empty lines, and conditionally excluded sections.
DTDFlatten tool is licensed under LGPL software license; but since it usually is not redistributed (and usage is free, ie. not limited by LGPL license in any way) the main thing to know is that in layman terms, "Anyone can use DTDFlatten for anything, but there is no warranty whatsoever ('if you break it, you can keep the pieces')".
Feedback (issues, suggestions, questions)
Since DTDFlatten is based on Woodstox Stax XML processor, its user mailing list (user at codehaus.org) is usually the best place to ask questions. At this point there is no separate mailing list for discussion regarding DTDFlatten, although one could be added if need arises.