This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Root node vs element root?


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]