[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Q: Numbering on parent position
Try <xsl:number count="level2" from="level1"/> -Ray Warren Hedley wrote: > > 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 XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|