Re: [xsl] preceding-sibling

Subject: Re: [xsl] preceding-sibling
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 11 Aug 2004 10:42:35 +0100
> self::preceding-sibling/person"/>.

The syntax for an axis is (in the basic case) axis::name and finds all
elements called name on tha axis, so the above uses the self axis (which
just has the current node) and finds all elements called
preceding-sibling then finds children of that called person
(It is an abreviated form of
self::preceding-sibling/child::person
in other wirds if teh current element is called preceding-sibling
it finds its children called person, otherwise it is empty.

If you want preceding sibling's called person that is

preceding-sibling::person

but I think you want 

preceding-sibling::section/person

Note that preceding-sibling::section selects _all_ preceding siblings,
and preceding-sibling::section/person selects all their children, but if
you
use xsl:value-of it will (always) just take the first selected node in
document order.

I think you want the _immediately_ preceding sibling, so that woul dbe

preceding-sibling::section[1]/person

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. 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
________________________________________________________________________

Current Thread