469,323 Members | 1,575 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

XSL Counter

MarkoKlacar
296 Expert 100+
Hi people,

does anybody know a simple way to implement a counter in XSL?

(Silly example)
Say if I want to color every thrid field blue how can I keep track of whan number I'm at?

Cheers
Nov 20 '07 #1
3 5397
Hi people,

does anybody know a simple way to implement a counter in XSL?

(Silly example)
Say if I want to color every thrid field blue how can I keep track of whan number I'm at?

Cheers
I am not sure how you are implementing it, but adding scripting language to the table may simplify it further
Nov 20 '07 #2
jkmyoung
2,057 Expert 2GB
This is most commonly done using position() or <xsl:number>: http://www.w3schools.com/xsl/el_number.asp. Example:
Expand|Select|Wrap|Line Numbers
  1. <xsl:number count="field"/>
  2. OR 
  3. <xsl:if test="position() mod 3 = 0">
  4.    Color me blue.
  5. </xsl:if>
  6.  
Nov 20 '07 #3
MarkoKlacar
296 Expert 100+
Hi guys,

thanks for your help, that's a nice link.

thanks you both.
Nov 21 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Shane | last post: by
16 posts views Thread by Paul Rubin | last post: by
7 posts views Thread by JellyON | last post: by
reply views Thread by Earl Anderson | last post: by
7 posts views Thread by mistral | last post: by
reply views Thread by Trevor L. | last post: by
12 posts views Thread by devospice | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.