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

Q: Numbering on parent position

Subject: Q: Numbering on parent position
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Mon, 22 Nov 1999 18:37:58 +1300
xslt parent position
I'm trying to insert a number into a text string based on the
position of the current node's parent. For example, from

<root>
  <level1><level2 /><level2 /></level1>
  <level1><level2 /><level2 /><level2 /></level1>
</root>

getting output of the form

1. info
1. info
2. info
2. info
2. info

where the numbers reflect the position of the <level1> parents.

I've tried things like

<xsl:for-each select="level1/level2">
  <xsl:number value="../position()" />
  <xsl:text>info</xsl:text>
</xsl:for-each>

with various value arguments, with no luck.

I'm guessing this is fairly easy, and I haven't read the XPath
spec that closely - any ideas?

Thanks in advance


-- 
Warren Hedley
Department of Engineering Science
Auckland University
New Zealand


 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.