Subject: Re: Q: Numbering on parent position From: Ray Waldin <rwaldin@xxxxxxxxxxx> Date: Sun, 21 Nov 1999 22:44:24 -0800 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Q: Numbering on parent position, Warren Hedley | Thread | namespace frustration, Mark D. Anderson |
namespace frustration, Mark D. Anderson | Date | RE: Simple XPath question, Sebastien Sahuc |
Month |