[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: building XML while referring to DTD
- From: David Brownell <firstname.lastname@example.org>
- To: Wendi Sisson <email@example.com>, firstname.lastname@example.org
- Date: Wed, 05 Sep 2001 08:25:46 -0700
> 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 .