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

RE: Numbering

Subject: RE: Numbering
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 14 Dec 1999 09:49:18 -0000
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


Current Thread
  • Numbering
    • Jon Wynacht - Mon, 13 Dec 1999 16:50:33 -0800
      • <Possible follow-ups>
      • Pawson, David - Tue, 14 Dec 1999 08:28:38 -0000
      • Kay Michael - Tue, 14 Dec 1999 09:49:18 -0000 <=

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.