Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Well-formedness and undeclared general entity references [Thread Next] Re: Well-formedness and undeclared general entity referencesTo: NULL Date: 4/10/2009 4:17:00 PM Fri, 10 Apr 2009 14:43:32 +0200, /Martin Honnen/: > Stanimir Stamenkov wrote: > >> Is an XML document using undeclared general entity references not >> well-formed? For example: >> >> <test> >> foo >> &bar; >> </test> > > See http://www.w3.org/TR/xml/#sec-references: > "Well-formedness constraint: Entity Declared > > In a document without any DTD, [...] for an entity reference that does > not occur within the external subset or a parameter entity, the Name > given in the entity reference MUST match that in an entity declaration > that does not occur within the external subset... If I have "document without any DTD" the wording "the Name given in the entity reference MUST match that in an entity declaration that does not occur within the external subset" is somewhat confusing for me as there's obviously no external subset. The other cases (stripped from the quotation): "a document with only an internal DTD subset which contains no parameter entity references, or a document with standalone='yes'" seems fine, but see my other message in this thread regarding the paragraph following the quoted one in the specification: > Note that non-validating processors are not obligated 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'. Even if I specify standalone='no' for the given example the parsing fails for me (again, I'm using Xerces2-J for what is worth). -- Stanimir | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
