|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: genx - doctype?
> John Cowan and others have suggested that genx should have a call to > put in a DOCTYPE declaration. This would be trivial to add to the > program but it bothers me, so I'm provisionally going to say that I'm > not doing this because it's not Canonical XML and the use cases are > thin. > > So this is a chance for people to say "I'd like to use genx for XXX, > but I can't withou a DOCTYPE because of YYY." -Tim Two points: 1) I do have a use case where I have a DTD validator running on top of a non-validating SAX parser (Expat based). Now I want to cache this (large) DTD after I have parsed it into an internal representation. However, there is a problem, running on top of a SAX parser, I have no way to "inject" entity declarations and attribute defaults back into the parser. So what I do is this: I extract all such declarations while parsing the DTD for the first time and *write* them out into a (much smaller) DTD, then I hand this small DTD to the parser, which does all the right replacements and defaults, and for validation I use the internal preloaded DTD. My use case requires writing out entity and attlist declarations, but not really a DocType declaration. 2) One would need a DocType declaration for such validating SAX parsers that don't support the EntityResolver2 interface, as there would be no way to associate the DTD with the document for validation within the SAX2 API. Karl
|
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
|
|||||||||

Cart








