Re: misleading? comments in xml REC text on <

Richard Tobin wrote
  (In a reply as I only just saw as I don't subscribe to this list
   and just looked in the archive now)

> The last paragraph of [1] may shed some light on the "No < in
> attribute values" WFC.

The paragraph cited is

  On the other hand, such a declaration seems to me to be harder to
  explain to users or implementors than the simple 'amp and lt are
  magic' rule that the spec currently uses.  Recall, moreover, that the
  goal is not simply to require that < and & characters be escaped where
  not markup, but to require that they be escaped with lt and amp.
  (Escaping them with something else is an error, I believe.  Not one
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  that parsers are required to detect and report, but an error
  nonetheless.)

Eeek, bad.

So there is (that paragraph claims) some magic property of lt.

If so is

  <!ENTITY ltamp '&#38;#60;&#38;#38;'>

OK as an entity declaration, and can I use that entity in an attribute
value, or is that not well formed due to <wfcnote id='CleanAttrVals'>

<p>The <termref def='dt-repltext'>replacement text</termref> of any entity
  referred to directly or indirectly in an attribute
  value (other than "<code>&amp;lt;</code>") must not contain
  a <code>&lt;</code>.

<x x="&ltamp;"/>

if ltamp does `contain an <' then this is not well formed.

If ltamp does not `contain an <' then neither does lt in which case
(other than "<code>&amp;lt;</code>") is redundant

David

Received on Wednesday, 22 March 2000 14:09:19 UTC