psychogene
%Europe/Berlin %539 %2005, 13:56
Dit is mijn xml bestand.
<?xml version="1.0" encoding="UTF-8"?>
<slideshow>
<album album_naam="album1" thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0020.JPG">
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0020.JPG" url="pics\Groove_City_'04\IMG_0020.JPG" opmerking="test" />
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0021.JPG" url="pics\Groove_City_'04\IMG_0021.JPG" opmerking="test" />
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0022.JPG" url="pics\Groove_City_'04\IMG_0022.JPG" opmerking="test" />
</album>
<album album_naam="album2" thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0011.JPG">
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0011.JPG" url="pics\Groove_City_'04\IMG_0011.JPG" opmerking="test" />
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0012.JPG" url="pics\Groove_City_'04\IMG_0012.JPG" opmerking="test" />
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0013.JPG" url="pics\Groove_City_'04\IMG_0013.JPG" opmerking="test" />
</album>
</slideshow>
Het aanroepen van het xml bestand werkt, maar heb een vraag hoe ik de verschillende albums kan aanspreken.
hiermee:
var fotos:Array = this.firstChild.firstChild.childNodes;
krijg ik al de fotos van het eerste album, maar om het 2de album te krijgen hoe gaat dat in zijn werk?
Ik weet dat het gaat met .nextSlibling, maar als je dan bv 100 albums hebt moet je dan 100 keer .nextSlibling gebruiken.
Of is hier een betere methode voor.
Hoop dat mijn vraag wat duidelijk is.
Grts
<?xml version="1.0" encoding="UTF-8"?>
<slideshow>
<album album_naam="album1" thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0020.JPG">
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0020.JPG" url="pics\Groove_City_'04\IMG_0020.JPG" opmerking="test" />
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0021.JPG" url="pics\Groove_City_'04\IMG_0021.JPG" opmerking="test" />
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0022.JPG" url="pics\Groove_City_'04\IMG_0022.JPG" opmerking="test" />
</album>
<album album_naam="album2" thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0011.JPG">
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0011.JPG" url="pics\Groove_City_'04\IMG_0011.JPG" opmerking="test" />
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0012.JPG" url="pics\Groove_City_'04\IMG_0012.JPG" opmerking="test" />
<foto thumb_url="pics\Groove_City_'04\thumb_Groove_City_'04\thumb_I MG_0013.JPG" url="pics\Groove_City_'04\IMG_0013.JPG" opmerking="test" />
</album>
</slideshow>
Het aanroepen van het xml bestand werkt, maar heb een vraag hoe ik de verschillende albums kan aanspreken.
hiermee:
var fotos:Array = this.firstChild.firstChild.childNodes;
krijg ik al de fotos van het eerste album, maar om het 2de album te krijgen hoe gaat dat in zijn werk?
Ik weet dat het gaat met .nextSlibling, maar als je dan bv 100 albums hebt moet je dan 100 keer .nextSlibling gebruiken.
Of is hier een betere methode voor.
Hoop dat mijn vraag wat duidelijk is.
Grts