XSLT numbering by attribute

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • James Merdan

    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
  • Dimitre Novatchev

    #2
    Re: XSLT numbering by attribute

    This is a grouping problem -- for a description of the Muenchian method for
    grouping see:

    Joacă jocuri online gratuite direct în browserul tău pe mobil, tabletă sau computer pe Jocuri Rix. Fără descărcări, fără înregistrări necesare.


    and




    =====
    Cheers,

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



    "James Merdan" <jamesmerdan@ya hoo.com> wrote in message
    news:3e6efa8e.0 309231927.51bb9 789@posting.goo gle.com...[color=blue]
    > 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[/color]


    Comment

    Working...