[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: building XML while referring to DTD
> I don't want to have to hard-code a different method for every XML > document I'm building. Is there a way to "parse" a DTD and then build > the XML as I iterate over the DTD? Or perhaps a tool or utility that > makes this easier? Or even some way to check before/during adding an > element whether it is valid for that DTD? Thanks, Wendi Most SAX2 parsers expose all the important DTD information [1, 2, 3]. You can save that information and use it later. Depending on how you save your DTD and document data, you may be able to validate your data at any time by turning your data into SAX events [4]. - Dave [1] http://sax.sourceforge.net/apidoc/org/xml/sax/ext/DeclHandler.html [2] http://sax.sourceforge.net/apidoc/org/xml/sax/ext/LexicalHandler.html [3] http://sax.sourceforge.net/apidoc/org/xml/sax/DTDHandler.html [4] http://www.gnu.org/software/classpathx/jaxp/apidoc/gnu/xml/pipeline/ValidationConsumer.html
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|