OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: PEs in Default Attribute Values



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@elcel.com]
> Sent: Wednesday, May 02, 2001 8:01 AM
> To: xml-dev@lists.xml.org
> 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@lists.xml.org
>