loop number and uppercase in xsl

Discussion in 'XML' started by f, Dec 1, 2003.

  1. f

    f Guest

    Here is my xml,

    <?xml version = "1.0"?>
    <Customer>
    <Order Name="Tennis" Quality="10" Time="10/03/03">
    <Order Name="Tennis" Quality="1" Time="1/03/03">
    <Order Name="Ball" Quality="100" Time="10/3/03">
    <Order Name="Tennis" Quality="100" Time="20/03/03">
    </Customer>

    I'm using xsl
    <xsl:for-each select="\Customer\Order">
    ...
    </xsl:for-each>

    I want to get something like:

    order[0].Name="TENNIS";
    order[0].Quality = 10;
    order[0].time="10/03/03";

    order[1].Name="TENNIS";
    order[1].Quality = 100;
    order[1].time="1/03/03";

    order[2].Name="BALL";
    order[2].Quality = 100;
    order[2].time="10/3/03";

    How can I get the loop number and change the Name to uppercase?


    Thanks.

    ff
     
    f, Dec 1, 2003
    #1
    1. Advertising

  2. "f" <> wrote in message
    news:...
    > Here is my xml,
    >
    > <?xml version = "1.0"?>
    > <Customer>
    > <Order Name="Tennis" Quality="10" Time="10/03/03">
    > <Order Name="Tennis" Quality="1" Time="1/03/03">
    > <Order Name="Ball" Quality="100" Time="10/3/03">
    > <Order Name="Tennis" Quality="100" Time="20/03/03">
    > </Customer>
    >
    > I'm using xsl
    > <xsl:for-each select="\Customer\Order">
    > ...
    > </xsl:for-each>
    >
    > I want to get something like:
    >
    > order[0].Name="TENNIS";
    > order[0].Quality = 10;
    > order[0].time="10/03/03";
    >
    > order[1].Name="TENNIS";
    > order[1].Quality = 100;
    > order[1].time="1/03/03";
    >
    > order[2].Name="BALL";
    > order[2].Quality = 100;
    > order[2].time="10/3/03";
    >
    > How can I get the loop number and change the Name to uppercase?


    Both are FAQs:

    1. Use the position() function (in your case you have to subtract 1 from
    what it returns)

    2. Use the translate() function.



    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL
     
    Dimitre Novatchev, Dec 1, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jurrie

    uppercase in XSLT/XSL-FO

    Jurrie, Oct 1, 2003, in forum: XML
    Replies:
    3
    Views:
    15,757
    Ben Edgington
    Jun 30, 2004
  2. Replies:
    1
    Views:
    3,657
    A. Bolmarcich
    May 27, 2005
  3. KingdomHeart
    Replies:
    0
    Views:
    453
    KingdomHeart
    Jan 23, 2009
  4. Erik the Red
    Replies:
    4
    Views:
    188
    Chris Pine
    Jul 29, 2005
  5. Isaac Won
    Replies:
    9
    Views:
    420
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page