W3C home > Mailing lists > Public > public-xml-core-wg@w3.org > May 2007

Re: XML clarification about < in attr values [was: Agenda for XML Core WG telcon of 2007 May 9]

From: Glenn Marcy <gmarcy@us.ibm.com>
Date: Wed, 9 May 2007 12:32:37 -0400
To: public-xml-core-wg@w3.org
Message-ID: <OF0E01E492.752F5F31-ON852572D6.00542447-852572D6.005AE343@us.ibm.com>
Incorporating Richard's comments, we propose the following
addition to Appendix D: 

In the following example 

<!DOCTYPE foo [ 
  <!ENTITY x "&lt;"> 
]> 
<foo attr="&x;"/> 

The replacement text of x is the four characters "&lt;" because
references to general entities in entity values are bypassed
[4.4.7].  The replacement text of lt is a character reference to
the less-than character, for example the five characters "&#60;"
[4.6].  Since neither of these contains a less-than character
the result is well-formed. 

If the definition of x had been 

  <!ENTITY x "&#60;"> 

then the document would not have been well-formed, because the
replacement text of x would be the single character "<" which
is not permitted in attribute values.

Regards,
Glenn
Received on Wednesday, 9 May 2007 16:32:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:21:35 GMT