Re: Entity references in Attr values

At 1:47 PM -0500 12/17/01, Joseph Kesselman wrote:

>Offhand, I think your choices are to either kick the user with an error
>message, or drop in an EntityReference node with null content (which
>therefore would not affect the attribute's string value), or (if you're
>flattening entity references) just drop the EntityReference (least useful),
>or some combination of the above. But I'd suggest you recheck the XML
>and/or Infoset RECs first to find out whether my memory of how unresolved
>entity refs may be handled is accurate.
>

I can't find anything in the XML 1.0 spec that's clearly on point 
here. I hadn't thought to look in the Infoset, but now that you 
suggested it I notice that the infoset does not define an attribute 
value. It does define a normalized attribute value by reference back 
to the XML 1.0 spec as follows:

[normalized value] The normalized attribute value (see 3.3.3 
Attribute-Value Normalization [XML]).

However, the algorithm for calculating the normalized attribute value 
in 3.3.3 fails in the event that external entity references are not 
available. Thus this appears to be a logical flaw in the infoset as 
well as the DOM.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+

Received on Monday, 17 December 2001 14:47:00 UTC