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

Re: Standalone and non-validating parsers-- clarification?


xml standalone yes

----- Original Message ----- 
From: "Jeff Rafter" <lists@j...>
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

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.