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] Standalone and non-validating parsers-- clarification?

[ Lists Home | Date Index | Thread Index ]


----- Original Message ----- 
From: "Jeff Rafter" <lists@jeffrafter.com>
Sent: Thursday, October 28, 2004 1:32 PM


> I was wondering if I could get some clarification on this paragraph:
> 
> http://www.w3.org/TR/REC-xml/#wf-entdeclared
> 
> "Note that non-validating processors are not obligated to to read and 
> process entity declarations occurring in parameter entities or in the 
> external subset; *for such documents*, the rule that an entity must be 
> declared is a well-formedness constraint only if standalone='yes'." 
> (emphasis added).
> 
> My question is as follows-- if you have a non-validating processor which 
> is processing entity declarations occurring in PEs or the ExtSubset is 
> it  also a violation of the WFC if it encounters an undeclared entity 
> ref even when standalone="no"?
> 
> I can't find a good way to make clear what I am asking-- I think my 
> expectation was that instead of "for such documents" it would read "for 
> such processors". There is an important distinction there and I think I 
> have just read it wrong so many times I can't get it straight.

When I re-implemented this in Expat, I found this WFC hard to understand,
so I rewrote it. Below is an excerpt from my patch description:

--- start ---

1) Re-implementation of WFC: Entity Declared.

I re-wrote the WFC in a way that was easier to understand for me:

First, I split the problem into two questions:

Q1) *When* should one check if a reference matches an entity declaration
    in the right location?
This is different depending on whether the reference is in the DTD
or the document content,
DTD:
  The reference is in the internal subset, and:
  a) If standalone = "yes": the reference is outside of any PE
  b) If standalone = "no" or undefined: So far no PE has been read
     (which implies the reference is outside of any PE)
Document content:
  A) The document has no DTD
  B) The document has only an internal subset, and this subset contains
     no PE references
  C) standalone = "yes"

Q2) What should one check then?
Reference in DTD *and* document content:
  An entity declaration with matching name was read, which is in the
  internal subset, but outside of any PE (which is automatically given
  in case Q1)-DTD-b)).
DTD:
  GE references in default attribute values must come after the matching
  GE declaration.

--- end ---

Btw, I worked on this in conjunction with section 5.1 of the spec.

Hope that helps,

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