[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Entity declarations and non-validating parsers
> At 12:58 PM -0500 2/23/03, Karl Waclawek wrote: > >I don't think complete validation is possible on top of SAX. > >AFAIR, there are a few entity related validity constraints that > >cannot be checked through SAX. > > Interesting. Looking at the spec, I only see one such validity > constraint that would seem to apply: Well, All I remember was that we got a request for more detailed reporting in Expat, since someone wanted to use it to build a DOM and to validate. It had to do with the fact that SAX does not report the entity boundaries for: - general entities within attribute values - parameter entities within declarations > Validity constraint: Entity Declared > > In a document with an external subset or external parameter entities > with "standalone='no'", the Name given in the entity reference must > match that in an entity declaration. For interoperability, valid > documents should declare the entities amp, lt, gt, apos, quot, in the > form specified in 4.6 Predefined Entities. The declaration of a > parameter entity must precede any reference to it. Similarly, the > declaration of a general entity must precede any attribute-list > declaration containing a default value with a direct or indirect > reference to that general entity. > > This leaves open the question of what a non-validating parser that > reads the DTD is supposed to do when it sees a parameter entity > reference before that entity is defined or an attribute-list > declaration containing a default value with a direct or indirect > reference to a general entity which is not yet defined. My best guess > is that it must then start acting like a non-DTD resolving parser, > and not process anything that occurs after the parameter entity > reference, but that's just a guess. That is actually not really trivial. I re-wrote the WFC (not VC) Entity Declared implementation in Expat as well as the implementation of section 5.1 of the XML 1.0 spec a while ago. The approach taken is documented in file attachment PatchImpl.txt for patch #578161: http://sourceforge.net/tracker/index.php?func=detail&aid=578161&group_id=10127&atid=310127. 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
|