doktorn
10-01-2002, 09:15 PM
Hello!
I want to extract data from an xml-sheet using javascript. I have a number of textfields in which I insert some of the data I need. So far so good.
I want to extract data from certain nodes and insert that data into a list. One of the problems is that it has to be done dynamically, it is not to be done a fixed number of times, some times it has to be done one time, other times it has to be done fourteen times.
My xml-sheet looks like this:
<?xml version="1.0" encoding="ISO8859-1" ?>
<personal>
<person>
<anstnr>1</anstnr>
<enamn>Eriksson</enamn>
<fnamn>Rikard</fnamn>
<sign>rier</sign>
<persnr>780101</persnr>
<skiftlag>1</skiftlag>
<disponibel>Ja</disponibel>
<merit>
<meritid>4</meritid>
<kurskod>B1</kurskod>
<exdag>2001-12-01</exdag>
</merit>
</person>
</personal>
I want to extract meritid, kurskod and exdag and place them in an array so that I can extract them by looping through the array. I´m planning to use javascript to do the looping part.
I appreciate any suggestions or help :-)
Many thanks in advance
I want to extract data from an xml-sheet using javascript. I have a number of textfields in which I insert some of the data I need. So far so good.
I want to extract data from certain nodes and insert that data into a list. One of the problems is that it has to be done dynamically, it is not to be done a fixed number of times, some times it has to be done one time, other times it has to be done fourteen times.
My xml-sheet looks like this:
<?xml version="1.0" encoding="ISO8859-1" ?>
<personal>
<person>
<anstnr>1</anstnr>
<enamn>Eriksson</enamn>
<fnamn>Rikard</fnamn>
<sign>rier</sign>
<persnr>780101</persnr>
<skiftlag>1</skiftlag>
<disponibel>Ja</disponibel>
<merit>
<meritid>4</meritid>
<kurskod>B1</kurskod>
<exdag>2001-12-01</exdag>
</merit>
</person>
</personal>
I want to extract meritid, kurskod and exdag and place them in an array so that I can extract them by looping through the array. I´m planning to use javascript to do the looping part.
I appreciate any suggestions or help :-)
Many thanks in advance