473,320 Members | 1,856 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,320 software developers and data experts.

XSLT numbering by attribute

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
Jul 20 '05 #1
1 1787
This is a grouping problem -- for a description of the Muenchian method for
grouping see:

http://www.topxml.com/code/default.a...20010129150851

and

http://jenitennison.com/xslt/grouping/index.html
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

"James Merdan" <ja*********@yahoo.com> wrote in message
news:3e**************************@posting.google.c om...
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

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
2
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only...
1
by: Mark247 | last post by:
Hi, When transforming an XSLT to HTML I get a very annnoying white spac gap of about 2px under each image. This is particularly annoying as am creating a vertical navigation menu made up of images...
4
by: dar_imiro | last post by:
Hi, I'm trying to get rid of frames as menu holder in my html-page. I'd also like to separate the menu structure to xml and xslt. Also the actual content is divided to xml and its corresponding...
1
by: arnold | last post by:
Hi, I've been knocking my head against the wall trying to create an XSL transform to perform "normalizations" of a set of XML files that have a common structure. % XML file before transform
1
by: Michael Doubez | last post by:
Hello, I want to mix in the same document Parts that have automatically numbered sections and parts which section are not numbered. Is there any out of the box way to locally suppress the...
2
jkmyoung
by: jkmyoung | last post by:
Here's a short list of useful xslt general tricks that aren't taught at w3schools. Attribute Value Template Official W3C explanation and example This is when you want to put dynamic values...
1
by: boetke | last post by:
Hi all, I am attempting to create an xslt transformation which I am having trouble with. I am fairly new to xslt and am having a hard time getting my head around it. The original xml file looks...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.