RE: [xsl] Root node vs element root?

Subject: RE: [xsl] Root node vs element root?
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 16 May 2001 17:26:38 +0100
> I'm trying to figure out the content of the root node. In my
> XML example
> I know the element root is <book>, but is the root node <?xml
> version="1.0" encoding="UTF-8"?> ???

No, the root node is best thought of as being the document itself - like the
document node in the DOM model. If you think of an element as being the
stuff between <a> and </a> tags, think of the root as being the stuff
between start-of-file and end-of-file.

The text '<?xml version="1.0" encoding="UTF-8"?>'

is an XML declaration, and it is not represented by a node in the XPath
tree, because the information is used only by the XML parser when
constructing the tree, and is of no interest thereafter.


> Also, does the XSLT processor even see/read the xml declaration?

No, it's dealt with by the XML parser.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread