Re: Entity references in Attr values

> I can't find anything in the XML 1.0 spec that's clearly on point
> here.

See XML 1.0, 2nd ed., § 5.2:
"The behavior of a validating XML processor is highly predictable; it must read
every piece of a document and report all well-formedness and validity
violations. [...] For maximum reliability in interoperating between different
XML processors, applications which use non-validating processors should not rely
on any behaviors not required of such processors. Applications which require
facilities such as the use of default attributes or internal entities which are
declared in external entities should use validating XML processors."

See also the definitions of "must" and "error" in § 1.2:

  "must
     [Definition: Conforming documents and XML processors are required
     to behave as described; otherwise they are in error. ]
   error
     [Definition: A violation of the rules of this specification; results 
     are undefined. Conforming software may detect and report an error 
     and may recover from it.]"

> 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.

The infoset defines "Entities" as follows:

"An information set describes its XML document with entity references already
expanded, that is, represented by the information items corresponding to their
replacement text. However, there are various circumstances in which a processor
may not perform this expansion. An entity may not be declared, or may not be
retrievable. A non-validating processor may choose not to read all declarations,
and even if it does, may not expand all external entities. In these cases an
unexpanded entity reference information item is used to represent the entity
reference."

See also the description of the [all declarations processed] property of the
Document Information Item:

"This property is not strictly speaking part of the infoset of the document.
Rather it is an indication of whether the processor has read the complete DTD.
Its value is a boolean. If it is false, then certain properties (indicated in
their descriptions below) may be unknown. If it is true, those properties are
never unknown."

So until the entity value of the &link; reference in your example is unknown the
[normalized value] property of the corresponding Attribute Information Item is
unknown, too.

-- 
=====================================================================
 Dieter Köhler, M. A. - dieter.koehler@ppp.uni-bamberg.de
 Schiffgasse 4a, D-69117 Heidelberg, +49(0)6221-485995
 "http://www.philo.de/Philosophie-Seiten/": 1000+ Philosophie-Links
 "http://www.philo.de/VirtualLibrary/14.de.htm": Deutsche Philo-Links
 "http://www.philo.de/xml/": Open XML - XML-Komponenten für Delphi
=====================================================================

Received on Tuesday, 18 December 2001 08:27:49 UTC