xsl-list
[Top] [All Lists]

Re: [xsl] Can a single XPath statement duplicate the functionality of this verbose <xsl:choose> statement?

2011-10-24 18:33:45

I still do not understand, for instance, the emphasis in the literature in distinguishing between the "root" and "the document node"; it seems not to have any impact on writing code. On the other hand, learning about result tree serialization will alter my code (I hope). Makes me wonder which other primitive XSLT notions would be as useful...


The terminology in the specs is just muddled here.

There's a node D representing the document, and a node E representing the outermost element.

D is sometimes called the document node, sometimes the root.

E is sometimes called the document element, sometimes the root element. (I call it the outermost element!)

Different specs use different terms, but the concepts are the same.

Note that in the XDM model used by XPath 2.0 and XSLT 2.0:

(a) a document node can have multiple element children

(b) any node (document nodes, element nodes, even text nodes) can be parentless, and thus be the root of a tree

although neither of these conditions will arise in a tree that results from parsing well-formed XML.

Michael Kay
Saxonica

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>