XML -> XSL conversion problem " for-each"

G

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>
 
G

Guest

already found it sorry !!

Spam sucks said:
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"> said:
<results ID="6"><![CDATA[Msg=99~~~~]]></results>
<results ID="7"><![CDATA[system connection is closed]]></results>
</result>
</socket>
</sockets>
 

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,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top