473,385 Members | 2,180 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,385 software developers and data experts.

XML -> XSL conversion problem " for-each"

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>
Jul 20 '05 #1
1 1482
already found it sorry !!

"Spam sucks" <nomail> schreef in bericht
news:40***********************@news.xs4all.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>

Jul 20 '05 #2

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

Similar topics

2
by: Miki Tebeka | last post by:
Hello All, I'm shipping an application using py2exe. With Python2.3 it worked fine but when switching to Python2.4 I started getting "warning: string/unicode conversion" all over the place. ...
8
by: Dgates | last post by:
Has anyone typed up an index for the O'Reilly book "C# and VB.NET Conversion?" I'm just learning C#, and often using this little book to see which VB.NET terms translate directly to some term in...
5
by: Hayato Iriumi | last post by:
When converting a type to another using CType and if the type conversion fails, it throw an exception. However, in C#, there is a keyword "as" which only makes the variable Nothing (null) without...
1
by: Philip Bondi | last post by:
Hello to all SQL Server junkies who work with non-English characters: For people running scripts from the command line using ANSI files with special characters, it is very important to use isql...
3
by: Steven T. Hatton | last post by:
There's probably something obvious I'm missing here, but I can't seem to figure out how to get this to work: ostream_iterator<wstring, wchar_t>(wcout,"\n")); When I try to compile it, I get an...
13
by: Jim in Arizona | last post by:
I made a page with a gridview that has rows show a different color if a number in a column is greater than or equal to 45. I also did this conditional formatting for the column next to it. Here's...
4
by: arnuld | last post by:
i wrote a programme to create a vector of 5 elements (0 to 4), here is the code & output: #include <iostream> #include <vector> int main() { std::vector<intivec; // dynamically create a...
0
by: Syd_Man | last post by:
I have a Gridview that is passing value to a detailsview controls using DefaultValue="EmployeeID = {0}" syntax however if I use the same syntax for the Integer it raises some Conversion error. ...
5
by: Damien | last post by:
Hi all, I'm using a pretty standard C++ Singleton class, as below: template <typename T> class Singleton { public: static T* Instance() {
11
by: arnuld | last post by:
i have created a new temperature conversion programme. it converts a temperature from Fahrenheit to Celsius or from Celsius to Fahrenheit at user's will. tell em if i need some improvements: ...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.