[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: genx - doctype?


sax parser progress


> 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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.