473,378 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 5518
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

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

Similar topics

4
by: Shane | last post by:
:) I am following a tutorial for php (hudzilla.org) absolutely loving it however I am having trouble with the counter example <?php // your content here... $filename = 'counter.txt'; // our...
16
by: Paul Rubin | last post by:
I'd like to have a function (or other callable object) that returns 0, 1, 2, etc. on repeated calls. That is: print f() # prints 0 print f() # prints 1 print f() # prints 2 # etc. ...
7
by: JellyON | last post by:
Hi. Is there a way to delay a call to a page counter (ie. call to a server script from an IMG tag) for the purpose to not lock the page loading awaiting counter be displayed. Maybe a...
0
by: Earl Anderson | last post by:
KB Article Q140908 provided the following function to create an Auto Incrementing Counter: Function Next_Custom_Counter () On Error GoTo Next_Custom_Counter_Err Dim MyDB As Database Dim...
7
by: mistral | last post by:
I use htaccess to protect directory and granting access to download file only for the authorized users. Just want implement simple PHP file download counter for single file. I need track the number...
0
by: Trevor L. | last post by:
I decide to put a custom Hit Counter on my page (below). Then I won't be reliant on the standard FrontPage one which uses webbots. It is called by <b>Hit Counter: </b><!--#include...
12
by: devospice | last post by:
Hi, I'm trying to create a download counter for individual files on a web site and I'm not sure how to do this. Right now I'm using Webalizer to just read the log files and see how many times...
5
by: jasonchan | last post by:
How would you set up a counter in javascript that goes from 5 to 0 This is what i have so far and it is not displaying in the div container "counter" for some reason... <!DOCTYPE html PUBLIC...
3
blackstormdragon
by: blackstormdragon | last post by:
Here were our instructions: "My mother always took a little red counter to the grocery store. The counter was used to keep tally of the amount of money she would have spent so far on that visit to...
2
by: gumbercules | last post by:
I am designing a site that is regulary updated with new podcasts. I would like to be able to have a counter next to each podcast showing how many hits/listens/plays/views each particular podcast has...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.