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

Re: Re: Finding the position of an element wrt to othe

Subject: Re: Re: Finding the position of an element wrt to other element
From: Brandon Ibach <brandon.ibach@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 21 Nov 2010 02:48:17 -0500
Re:  Re: Finding the position of an element wrt to othe
On Sun, Nov 21, 2010 at 1:32 AM, Rashi Bhardwaj
<rashi.bhardwaj@xxxxxxxxx> wrote:
> with 342, it means the position of that b element which have child c
> and relative to first b element (whether it has child c or not); as
> specified my xpath
>
> ="//b[c][not(@name=preceding::b[child::c]/@name)]/@name
>
> With the above xpath in my sample xml three b element will be select,
> namely, b[@name='3'], b[@name='4'] and b[@name='2'], now the position
> of these above selected b elements relative to first 'b' element
> (b[@name='1']) will be 3 and 4 for the b's which are child of first
> <a> and 2 for the b in second <a>.

Instead of:

    <xsl:value-of select="position()"/>

try something like:

    <xsl:number level="single" format="1"/>

-Brandon :)

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.