472,119 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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 5474
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.