XML -> XSL conversion problem " for-each"

Discussion in 'XML' started by Spam sucks, Jun 4, 2004.

  1. Spam sucks

    Spam sucks Guest

    hello,

    i create a logging xml file with dom that could have an unknown count of
    results now it is 0 to 7 but it could be i have 14 or 50 results how can you
    read this out with xsl, with php you would put it in an array or something
    but now i want to do it with xsl.

    in php it woul be like:
    foreach ($array as $key=>$value)
    {
    echo "$key - $value <br />";
    }

    i can change the xml so if you could give me some pointers it would be
    great.

    Thanks in advance

    <sockets>
    <socket ID="334433" tijd="1086361564" type="">
    <result>
    <results ID="0"><![CDATA[Connectie]]></results>
    <results ID="1"><![CDATA[msg=90;Name=R!M - RX_COMM~~~~]]></results>
    <results ID="2"><![CDATA[Msg=90;Name=system;Data=WEB~~~~]]></results>
    <results ID="3"><![CDATA[msg=0~~~~]]></results>
    <results ID="4"><![CDATA[Msg=50~~~~]]></results>
    <results ID="5"><![CDATA[msg=501;Result=Success;Count=1~~~~]]></results>
    <results ID="6"><![CDATA[Msg=99~~~~]]></results>
    <results ID="7"><![CDATA[system connection is closed]]></results>
    </result>
    </socket>
    </sockets>
     
    Spam sucks, Jun 4, 2004
    #1
    1. Advertising

  2. Spam sucks

    Spam sucks Guest

    already found it sorry !!

    "Spam sucks" <nomail> schreef in bericht
    news:40c091d1$0$34762$4all.nl...
    > hello,
    >
    > i create a logging xml file with dom that could have an unknown count of
    > results now it is 0 to 7 but it could be i have 14 or 50 results how can

    you
    > read this out with xsl, with php you would put it in an array or something
    > but now i want to do it with xsl.
    >
    > in php it woul be like:
    > foreach ($array as $key=>$value)
    > {
    > echo "$key - $value <br />";
    > }
    >
    > i can change the xml so if you could give me some pointers it would be
    > great.
    >
    > Thanks in advance
    >
    > <sockets>
    > <socket ID="334433" tijd="1086361564" type="">
    > <result>
    > <results ID="0"><![CDATA[Connectie]]></results>
    > <results ID="1"><![CDATA[msg=90;Name=R!M - RX_COMM~~~~]]></results>
    > <results ID="2"><![CDATA[Msg=90;Name=system;Data=WEB~~~~]]></results>
    > <results ID="3"><![CDATA[msg=0~~~~]]></results>
    > <results ID="4"><![CDATA[Msg=50~~~~]]></results>
    > <results

    ID="5"><![CDATA[msg=501;Result=Success;Count=1~~~~]]></results>
    > <results ID="6"><![CDATA[Msg=99~~~~]]></results>
    > <results ID="7"><![CDATA[system connection is closed]]></results>
    > </result>
    > </socket>
    > </sockets>
    >
    >
     
    Spam sucks, Jun 4, 2004
    #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. f
    Replies:
    2
    Views:
    511
    Arto V. Viitanen
    Nov 20, 2003
  2. Sparko
    Replies:
    0
    Views:
    420
    Sparko
    Jul 9, 2004
  3. Tjerk Wolterink

    xsl:for-each for each 3 elements problem

    Tjerk Wolterink, Nov 3, 2004, in forum: XML
    Replies:
    3
    Views:
    455
    Tjerk Wolterink
    Nov 3, 2004
  4. Replies:
    1
    Views:
    3,686
    A. Bolmarcich
    May 27, 2005
  5. Konkee
    Replies:
    1
    Views:
    634
    Joris Gillis
    Jul 6, 2005
Loading...

Share This Page