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

RE: counter vs. functional counterpart

Subject: RE: counter vs. functional counterpart
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 21 Jul 2009 09:17:47 +0100
RE:  counter vs. functional counterpart
<xsl:template match="name|nickName">
  <xsl:number level="any" count="name|nickName"/>
  <xsl:text>-</xsl:text> 
  <xsl:value-of select="."/>
  <xsl:text>&#xa;</xsl:text>
</xsl:template>

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay  

> -----Original Message-----
> From: Jeff Shelley [mailto:jshelley@xxxxxxxxxxxxxxxxxxxx] 
> Sent: 21 July 2009 04:54
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  counter vs. functional counterpart
> 
> Hello.
>     Does anybody know what xsl file can take this:
> 
> <rows>
>     <row>
>         <name>John</name>
>         <otherName/>
>     </row>
>     <row>
>         <name>Paul</name>
>         <otherName/>
>     </row>
>     <row>
>         <name>Ringo</name>
>         <nickName>ClassCastException</nickName>
>     </row>
>     <row>
>         <name>George</name>
>         <otherName/>
>     </row>
> </rows>
> 
> 
> and turn it into this?
> 
> 	1-John
> 	2-Paul
> 	3-Ringo
> 	4-ClassCastException
> 	5-George
> 
> Basically, I need the output number to keep incrementing and 
> be continuous.  Everything I see about counters says "if 
> you're implementing a counter you're doing it wrong", but I 
> have absolutely no idea how to do this.
> 
> I'd appreciate any help.  Thanks!
> 
> --
> Jeff Shelley, Director of Software Development Stuntman 
> Software, Inc http://www.stuntmansoftware.com
> 949-533-4513

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.