This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Root node vs element root?
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Root node vs element root?
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Wed, 16 May 2001 17:26:38 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> 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