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

RE: PEs in Default Attribute Values

  • From: Jason Diamond <jason@i...>
  • To: Rob Lugt <roblugt@e...>, xml-dev@l...
  • Date: Thu, 03 May 2001 00:35:57 -0700

pes parser
This one's tricky. Parameter entity references can only appear at the
top-level in the internal subset. This is actually a well-formedness
constraint so conformant XML processors would be required to report it as an
error and not just silently pass it through as literal text.

http://www.w3.org/TR/REC-xml#wfc-PEinInternalSubset

I suspect that the test is wrong if it expects any output at all since it
should have stopped processing before encountering the document element.

Jason.

> -----Original Message-----
> From: Rob Lugt [mailto:roblugt@e...]
> Sent: Wednesday, May 02, 2001 8:01 AM
> To: xml-dev@l...
> Subject: PEs in Default Attribute Values
>
>
> Dear all,
>
> I would like clarification and consensus on how to treat PEs
> within default
> attribute values.
>
> The Oasis test suite contains a good example within the James Clark tests:
> xmltest/valid/sa/094.xml.  For convenience I will repeat the test files
> here:-
>
> <!DOCTYPE doc [
> <!ENTITY % e "foo">
> <!ELEMENT doc (#PCDATA)>
> <!ATTLIST doc a1 CDATA "%e;">
> ]>
> <doc></doc>
>
> At first sight it appears that the "%e;" should be dealt with as a PE in a
> similar way to an entity literal value.  However, this is open to some
> interpretation.  The canonical output file from James Clark's test looks
> like this:
>
> <doc a1="%e;"></doc>
>
> which clearly indicates that the %e; is not recognised as a PE at
> all.  One
> justification for this way of thinking can be found in XML 1.0 Section 4.4
> which states that PEs referenced in Attribute Values are "not recognised".
> But it could be argued they are not recognised simply because Attribute
> Values only occur outside of DTDs.  Section 3.3.2 (production [60]
> DefaultDecl) only states that the processor should "behave as though the
> attribute were present with the declared default value".  It does not
> mention "replacement text" which is the term used for entity values.
>
> When we wrote the ElCel parser we took James' test as an indication of the
> way to go.  But I see that the Oasis tests have now been amended to show
> that this test was in error.
>
> Clearly there is some ambiguity here.  Either they should be treated in a
> similar way to literal entity values (where the PEs are expanded
> into their
> replacement text without the addition of 0x20 on either side), or they
> should be "not recognised" as James Clark's example indicates.  For parser
> writers the latter is probably cleaner and more efficient, but what is the
> consensus?
>
> Kind regards
> Rob Lugt
> http://www.elcel.com
>
>
>
> ------------------------------------------------------------------
> The xml-dev list is sponsored by XML.org, an initiative of OASIS
> <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To unsubscribe from this elist send a message with the single word
> "unsubscribe" in the body to: xml-dev-request@l...
>


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-2007 All Rights Reserved.