Re: Root Node does not contain prolog?

Subject: Re: Root Node does not contain prolog?
From: James Clark <jjc@xxxxxxxxxx>
Date: Sun, 25 Apr 1999 07:19:19 +0700
Elliotte Rusty Harold wrote:
> Section 4.1 of the new XSLT spec, Root Node, states:
> "The root node is the root of the tree. It does not occur anywhere else
> in the tree. It has a single child which is the element node for the
> document element of the document.

That last sentence is a bug.  Comments and PIs before and after the
document element would also be children of the root.

> The value of the root node is the value of the document element."

That's defining the term "value" for the root node.  It means that
<xsl:value-of select="/"/> gives you the same as <xsl:value-of
select="doc"/> if doc is the document element.

> This would seem to imply that an XSL processor can never access any part
> of the prolog including the XML declaration, the xml-stylesheet PI, or
> the DTD since these are not children of the root.

The xml-stylesheet PI is accessible; the XML declaration and DTD are

> Furthermore, this
> makes an identity transformation impossible.  Is this indeed the intent,
> here?

It depends what you mean by identity transformation.  You can do a
transformation which gives you the same abstract tree before and after.
You cannot do a transformation which gives you a byte for byte identical
XML document.  That is indeed the intent.


 XSL-List info and archive:

Current Thread