xsl-list
[Top] [All Lists]

Re: [xsl] Diagram of XPath axes

2012-05-24 12:02:39
Just a side note: If you want to select the preceding elements *including the ancestors*, use the XPath 2 << operator [1], which selects the nodes that precede the current in document order [2].

In XSLT: select="*[. &lt;&lt; current()]"

–Gerrit

[1] http://www.w3.org/TR/xpath-functions/#func-node-before
[2] http://www.w3.org/TR/xpath-datamodel/#document-order


On 2012-05-24 15:09, Ihe Onwuka wrote:
On Thu, May 24, 2012 at 1:58 PM,<mlcook(_at_)wabtec(_dot_)com>  wrote:

One additional question, please:

Preceding nodes do not include ancestors, which I've thought is odd.  It 
includes siblings, but not parent or grand-parent, etc.

When looking at an XML file in an editor, ancestors surely seem to be preceding 
where I am in the document.

Ancestors  start before where you are but they have not ended,
therefore they don't precede you.

--~------------------------------------------------------------------
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>
--~--


--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

--~------------------------------------------------------------------
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>