[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Navigation using XPath

Subject: Re: Navigation using XPath
From: Allister Jenks <arj@xxxxxxxxxxx>
Date: Wed, 13 Nov 2002 22:10:11 +1300
navigate xsl position
On Wednesday, 13 November 2002 at 9:46 p.m. Chitra wrote:

> Is there anyway to navigate through the XML document using stylesheet by
> which I can do the following without explicitly specifying the node
> position like position() = 1 or position() = 2 etc. As far as I know
> only 'last()' is available which extracts the last value of the
> specified element.

<snip>

> I know that following-sibling axis is available but it returns all the
> following siblings and not just the next one which is not useful if I
> want to move through the nodes one by one (either forward or backward)
> and perform some operations. Similar is the problem with
> preceding-sibling or following or preceding and other similar axis

> So is there any way to do this ?

Wow, I'm new to the list and yet I think I know the answer to this
one, at least in principle.

I have in one of my style sheets the following construct:

following-sibling::element[position() &lt; 3]

This is selecting elements within 3 of the context element, so in your
case, I would imagine the 'next()' function could be accomplished
with:

following-sibling::element[position()=1]

Not tested, but it would seem to be to be the answer.  Hope it helps.

-- 
Regards,

Allister


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.