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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Entity declarations and non-validating parsers

[ Lists Home | Date Index | Thread Index ]

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:

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.

I'll have to write some experiments and see what non-validating 
parsers actually do in this case.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|           Processing XML with Java (Addison-Wesley, 2002)          |
|              http://www.cafeconleche.org/books/xmljava             |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+




 

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

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