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

Re: position of the parents node -> XSLT1.1

Subject: Re: position of the parents node -> XSLT1.1
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 9 May 2006 13:29:33 +0100
position xslt example
Note that there will never be an XSL 1.1 the working draft was withdrawn
and the working group decided to work on XSLT2 (which is almost, but not
quite, now finalised) So it's best not to rely on features in the 1.1
draft (although saxon 6 does implement them if you specify version=1.1
in the stylesheet)

> Xpath's like this "parent::position()" dont'nt work. 

 You can't, in XSLT1, use a function returning an integer as a step of an
 XPath, and (in XSLT 1 and 2) you can only use a node name and not a
 function after an axis such as parent::


However you do not want the position() function at all, which is
unrelated to the position of a node in the input, it just relates to the
position in the current node list. So for example if you select a node
with parent::* it will always have position()=1 as there is only one
node selected.

I think you want the number of preceding sibling elements of the parent, which
is
select="count(../preceding-sibling::*)+1"

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
________________________________________________________________________

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.