XSLT numbering by attribute

J

James Merdan

Hi,
I'm having an issue I was hoping someone could help me with. I have
a number of tags which have an attribute 'type' like this:
<data file="file1.jpg" type="image"/>
<data file="file2.jpg" type="image"/>
<data file="file3.jpg" type="image"/>
<data file="file1.txt" type="text"/>
<data file="file2.txt" type="text"/>
<data file="file1.bin" type="binary"/>

etc...

Now I can get a total count by data/@type like this:
image : 3
text : 2
binary : 1

But what I want to be able to do is get a running total like this:
file1.jpg image 1 of 3
file2.jpg image 2 of 3
file3.jpg image 3 of 3
...

I'm stuck with the XML coming in the way it is, so is there a way to
do this with XSL?

Thanks,
James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top