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: Richard Tobin <richard@inf.ed.ac.uk>
Date: Wed, 9 May 2007 13:20:38 +0100 (BST)
To: "Grosso, Paul" <pgrosso@ptc.com>, <public-xml-core-wg@w3.org>
Message-Id: <20070509122038.A6338200BAA@macpro.inf.ed.ac.uk>

> If we copy what was in the e-mail exchange and expand upon it somewhat 
> we get the following proposed 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 referrences 

Should be "references".

> to general entities in entity values are bypassed [4.4.7].  The replacement 
> text of lt is the five characters "&#60;" [4.6].

The replacement text is not necessarily exactly that.  It might be "&#x3c;"
for example.  Say

  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. 

-- Richard
Received on Wednesday, 9 May 2007 12:31:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:40:33 UTC