Re: DOM Level 1 doesn't do everything

On 1998-07-28, Stephen R. Savitzky wrote:

> The specification clearly states: 
> 
>   EntityReference objects are inserted into the DOM by the XML processor
>   whenever the processor sees a reference to an entity other than the
>   pre-defined character entities in the XML specification. The replacement
>   value, if it is available, will appear in the child list of the
>   EntityReference.
> 
> One might hedge this by saying that the replacement value of an entity is
> ``not available'' to an editor even if it's in the DTD, but that's a pretty
> severe distortion of the spec.  The requirement to replace and re-insert
> character entities is also a pain in the neck.  We're ignoring it, of
> course, in the interests of efficiency, but it's another distortion, and
> another reason our application simply doesn't conform.

Not to worry.  There are no such things as "character entities" in XML.
There are "character references", the "&#nnnn" and "&#xnnnn" things,
but there are no "character entities" that they refer to.

What the above quotation from the DOM WD presumably means is that
references to "lt", "gt", "quot", "apos", and "amp" need not be
treated as Entity objects, but can be incorporated in Text nodes.
Likewise with character references, since they are not references
to entities.

So it's only references to declared parsed entities (and only
internal entities at that, if the reference is still to Attribute
nodes).

-- 
John Cowan	http://www.ccil.org/~cowan		cowan@ccil.org
	You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.
	You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.
		Clear all so!  'Tis a Jute.... (Finnegans Wake 16.5)

Received on Tuesday, 18 August 1998 12:25:18 UTC