Re: Entity references in Attr values

At 7:01 PM +0100 12/18/01, Dieter Köhler wrote:

>Take into account the meaning of "must" in the first sentence.  If a 
>validating
>processor does not read an external entity it is in error, i.e. it is in the
>same state as when detecting a violation of an validity constraint, ergo the
>whole document is not valid.
>

The question is not what happens with a validating parser. That's 
never been at issue. The question is what happens with a 
non-validating parser.

>>  That's believable. In the Infoset in this case the normalized value
>>  is simply unknown. That still doesn't answer the question of what DOM
>>  implementations should return here, though. Null perhaps?
>
>The DOM 2 spec says about the EntityReference: "... it may be that there is no
>Entity node representing the referenced entity. If such an Entity exists, then
>the subtree of the EntityReference node is in general a copy of the 
>Entity node
>subtree ..."  So, if no such Entity exists (because the parser was for example
>not able to provide one), there is no subtree for the EntityReference.

However, this still doesn't tell us what the value of the attribute 
is or what DOM should return for the value of the Attr when the 
actual attribute value contains an unresolved entity reference. DOM 
does not define the value of the attribute in terms of the value of 
its child nodes.

>  Note
>also that it is out of the scope of least DOM 2, what exactly a 
>parser should do
>if it cannot validate a document.

That's definitely not true. DOM does not require validation or a 
validating parser. It works with merely well-formed documents that do 
not have a DTD. It also works with documents that are valid and do 
have DTDs, but which are processed by a non-validating parser.

The problem is that the behavior of a couple of methods in the Node 
and Attr in classes is underspecified in this case.
-- 

+-----------------------+------------------------+-------------------+
| 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 Tuesday, 18 December 2001 14:20:27 UTC