xsl-list
[Top] [All Lists]

Re: Getting the first preceding-sibling with a specific child element

2005-01-26 05:12:44


   preceding-sibling::x[title][1]

This will select the first x element (counting backwards) that has a
title. (so will return at most 1 node)

   preceding-sibling::x/title[1]

This will select the first title element of each of the selected x
elements so will return any number of nodes.

  (preceding-sibling::x/title)[1]

This will select the first title elemnt (in document order) that is a
child of the preceding sibling x elements (so will return at most 1
node)

From your description, I think you want the first of these.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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