OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] genx - doctype?

[ Lists Home | Date Index | Thread Index ]



> 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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS