Re: [xsl] Retrieving top-level attribute value in XSLT 2.0

Subject: Re: [xsl] Retrieving top-level attribute value in XSLT 2.0
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Thu, 31 Aug 2006 23:30:30 +0100
On 8/31/06, David Carlisle <davidc@xxxxxxxxx> wrote:
the top level elemnt the root element, although that terminoligy is
sometimes used, it's best not to use it in xslt/xpath as xpath (1) a
root node is always the _parent_ of the top level element, not the
element itself. So there is never a "root element".

my 2p...


top-level elements are those things that are child nodes of
xsl:stylesheet|xsl:transform

http://www.w3.org/TR/xslt#dt-top-level

In an XML document there is a root element and a root node.  The root
node is the level above the root element.  Its not too bad to think
about when you can distinguish between an element (something between
angle brackets) and a node (say a text node or attribute node). XML is
a tree, so it should really have a root.

Googling around though, shows "top-level element" refers to both  the
single root element of an xml document (in error messages), and the
top-level child elements in xslt.... One must be wrong.

Current Thread