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

PEs in Default Attribute Values

  • From: Rob Lugt <roblugt@e...>
  • To: xml-dev@l...
  • Date: Wed, 02 May 2001 16:00:56 +0100

xmltest james clark
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



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.