Hi everyone,
I'm using Flash 6, AS 1.
I know how to parse xml-data like:
I then parse the data in Flash with:Code:<?xml version="1.0"?>
<galery>
<img>
<url>url1</url>
<caption>caption1</caption>
</img>
<img>
<url>url2</url>
<caption>caption2</caption>
</img>
</galery>
etceteraCode:var hItems = this.firstChild.childNodes
createEmptyMovieClip("hold", 1);
for (n=0; n<hItems.length; n++) {
But here'my problem: I have to parse an xml-file with another (higher) level, and I haven't been able so far to create a 2nd array that parses nodes parsed by the first array. Here's the xml-sample:
The categories and articles will vary in number, the child nodes of article stay the same in number.Code:<?xml version="1.0"?>
<thedata>
<category>
<categoryname>category 1</categoryname>
<article>
<articlename>articlename 1 of category 1</articlename>
<articletext>articletext 1 van category 1</articletext>
<articlelink>mailform.php?artikelID=1</articlelink>
</article>
<article>
<articlename>articlename 2 of category 1</articlename>
<articletext>articletext 2 van category 1</articletext>
<articlelink>mailform.php?artikelID=2</articlelink>
</article>
</category>
<category>
<categoryname>category 2</categoryname>
<article>
<articlename>articlename 1 of category 2</articlename>
<articletext>articletext 1 van category 2</articletext>
<articlelink>mailform.php?artikelID=3</articlelink>
</article>
<article>
<articlename>articlename 2 of category 2</articlename>
<articletext>articletext 2 van category 2</articletext>
<articlelink>mailform.php?artikelID=4</articlelink>
</article>
</category>
<category>
<categoryname>category 3</categoryname>
<article>
<articlename>articlename 1 of category 3</articlename>
<articletext>articletext 1 van category 3</articletext>
<articlelink>mailform.php?artikelID=5</articlelink>
</article>
<article>
<articlename>articlename 2 of category 3</articlename>
<articletext>articletext 2 van category 3</articletext>
<articlelink>mailform.php?artikelID=6</articlelink>
</article>
</category>
</thedata>
So, with my earlier Actionscript I can see all the nodes, but how can I substract the child nodes of the article-nodes?
Thank you very much for helping me!
