xsl-list
[Top] [All Lists]

RE: [xsl] counter vs. functional counterpart

2009-07-21 04:18:19

<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(_at_)stuntmansoftware(_dot_)com] 
Sent: 21 July 2009 04:54
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--