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

I am breaking out this email so that we can discuss it
at our upcoming telcon.

Please read and comment on Glenn's proposed wording in
email before the telcon if at all possible.

Richard, Henry, Norm, 

You are especially requested to comment.

paul

-----Original Message-----
From: public-xml-core-wg-request@w3.org On Behalf Of Glenn Marcy
Sent: Monday, 2007 May 07 16:39
To: public-xml-core-wg@w3.org

> XML clarification
> -----------------
> Norm sent email about < in attribute values at
> http://lists.w3.org/Archives/Public/public-xml-core-wg/2007Apr/0006
> Richard replied at
> http://lists.w3.org/Archives/Public/public-xml-core-wg/2007Apr/0007
> 
> Henry doesn't see why Richard's explanation makes the problem go
> away.  Glenn explains it, but Henry points out that more explanation
> would be useful--at least in the test, and maybe in the spec.
> 
> Glenn suggested putting something in the table near the end (4.4)
> if we put anything in the spec.
> 
> Henry suggests adding an example such as this case to Appendix D
> (in XML 1.0 4th Ed).
> 
> ACTION to Glenn:  Suggest some wording/example to add to the spec
> that covers the "< in attribute value" issue (actually, internal 
> entity in attributes).

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 
to general entities in entity values are bypassed [4.4.7].  The
replacement 
text of lt is 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. 

Received on Tuesday, 8 May 2007 18:50:47 UTC