Flash XML - hent id nr. fra node
Hejsa,Hvordan henter jeg <Location id="1"> fra følgende XML kode.
Jeg skal bare have id nummeret:
<Locations>
<Location id="1">
<name>Lindpro a/s</name>
<address>Ærøsvej 5 B</address>
<postalcode>4700</postalcode>
<city>Næstved</city>
<phone>+45 55 77 91 41</phone>
<fax>+45 55 37 39 20</fax>
<email>naestved@lindpro.dk</email>
</Location>
<Location id="6">
<name>Lindpro a/s</name>
<address>Fabriksparken 58</address>
<postalcode>2600</postalcode>
<city>Glostrup</city>
<phone>+45 70 10 16 17</phone>
<fax>+45 43 26 09 99</fax>
<email>lindpro@lindpro.dk</email>
</Location>
<Location id="7">
<name>Lindpro a/s</name>
<address>Skibbrogade 10</address>
<postalcode>4400</postalcode>
<city>Kalundborg</city>
<phone>+45 59 55 04 00</phone>
<fax>+45 59 55 04 01</fax>
<email>kalundborg@lindpro.dk</email>
</Location>
De andre ting henter jeg via denne metode:
minvariabel = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
Men som sagt, kan jeg ikke finde ud af at hente det ID nr. der står i <Locations id="xx">.
