|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Numbering
> > I want to number the following: > > <?xml version="1.0" ?> > <PXML> > <Procedures> > <Procedure_telnet>First Telnet</Procedure_telnet> > <Procedure>First Procedure</Procedure> > <Procedure>Second Procedure</Procedure> > <Procedure>Third Procedure</Procedure> > <Procedure>Fourth Procedure</Procedure> > <Procedure_telnet>Second Telnet</Procedure_telnet> > <Procedure>Fifth Procedure</Procedure> > </Procedures> > </PXML> > > But they don't come out 1, 2, etc. It comes out 1, 1, 2, 3, 4, 2, 5. > <xsl:number> with no count attribute numbers the nodes that match the current node's name and type. To number these nodes in a single sequence, use <xsl:number count="Procedure|Procedure_telnet"/>. Alternatively, use the position() function instead, it's almost certainly faster. You may need to change the xsl:apply-templates to say "select='*'" to avoid numbering the whitespace nodes between the elements, or use xsl:strip-space elements="Procedures"/> BTW, I don't know what you're trying to achieve with <xsl:preserve-space elements=""/> It looks like a no-op to me. Mike Kay 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
|

Cart








