Hellow,
I’m working on a XML update modulle, but i have a big problem with my insertBefore
I’m just trying to add an <xxx> tag before the <newsItem> tag for the moment, He only does inserts it befor the first <newsItem> tag, he refuses to do it before the 2nd, 3rd or 4th newsItem tag
Can somebody pleaaaase help me :-/
This is the XML code (for a better view http://www.goadesign.be/3sexy.xml )
[color=#0000ff]<?xml version="1.0" ?>[/color]
[**[font=Courier New][color=#ff0000]-[/color][/font]**](http://www.goadesign.be/3sexy.xml#) [color=#0000ff]<[/color][color=#990000]newsXML[/color][color=#0000ff]>[/color]
[**[font=Courier New][color=#ff0000]-[/color][/font]**](http://www.goadesign.be/3sexy.xml#) [color=#0000ff]<[/color][color=#990000]newsItem[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]id[/color][color=#0000ff]>[/color]**1**[color=#0000ff]</[/color][color=#990000]id[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]title[/color][color=#0000ff]>[/color]**titel1**[color=#0000ff]</[/color][color=#990000]title[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]date[/color][color=#0000ff]>[/color]**vandaag**[color=#0000ff]</[/color][color=#990000]date[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]message[/color][color=#0000ff]>[/color]**bericht1**[color=#0000ff]</[/color][color=#990000]message[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]link[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]pict0[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]pict1[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]</[/color][color=#990000]newsItem[/color][color=#0000ff]>[/color]
[**[font=Courier New][color=#ff0000]-[/color][/font]**](http://www.goadesign.be/3sexy.xml#) [color=#0000ff]<[/color][color=#990000]newsItem[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]id[/color][color=#0000ff]>[/color]**2**[color=#0000ff]</[/color][color=#990000]id[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]title[/color][color=#0000ff]>[/color]**titel2**[color=#0000ff]</[/color][color=#990000]title[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]date[/color][color=#0000ff]>[/color]**morgen**[color=#0000ff]</[/color][color=#990000]date[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]message[/color][color=#0000ff]>[/color]**beeericht**[color=#0000ff]</[/color][color=#990000]message[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]link[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]pict0[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]pict1[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]</[/color][color=#990000]newsItem[/color][color=#0000ff]>[/color]
[**[font=Courier New][color=#ff0000]-[/color][/font]**](http://www.goadesign.be/3sexy.xml#) [color=#0000ff]<[/color][color=#990000]newsItem[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]id[/color][color=#0000ff]>[/color]**3**[color=#0000ff]</[/color][color=#990000]id[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]title[/color][color=#0000ff]>[/color]**titel3**[color=#0000ff]</[/color][color=#990000]title[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]date[/color][color=#0000ff]>[/color]**vandaag**[color=#0000ff]</[/color][color=#990000]date[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]message[/color][color=#0000ff]>[/color]**bericht1**[color=#0000ff]</[/color][color=#990000]message[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]link[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]pict0[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]pict1[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]</[/color][color=#990000]newsItem[/color][color=#0000ff]>[/color]
[**[font=Courier New][color=#ff0000]-[/color][/font]**](http://www.goadesign.be/3sexy.xml#) [color=#0000ff]<[/color][color=#990000]newsItem[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]id[/color][color=#0000ff]>[/color]**4**[color=#0000ff]</[/color][color=#990000]id[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]title[/color][color=#0000ff]>[/color]**titel4**[color=#0000ff]</[/color][color=#990000]title[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]date[/color][color=#0000ff]>[/color]**overmorgen**[color=#0000ff]</[/color][color=#990000]date[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]message[/color][color=#0000ff]>[/color]**blablablabla**[color=#0000ff]</[/color][color=#990000]message[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]link[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]pict0[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]<[/color][color=#990000]pict1[/color] [color=#0000ff]/>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]</[/color][color=#990000]newsItem[/color][color=#0000ff]>[/color]
**[font=Courier New][color=#ff0000] [/color][/font]** [color=#0000ff]</[/color][color=#990000]newsXML[/color][color=#0000ff]>[/color]
And this is my AS code
for (nodeTeller=0; nodeTeller<xmlData.firstChild.childNodes.length; nodeTeller++)
{
idMatch = xmlData.firstChild.childNodes[nodeTeller].childNodes[0].firstChild.nodeValue;
//Controleren of het ID al bestaat
if (itemID == idMatch)
{
trace("we have a match!");
//als het ID al bestaat een nieuw <newsItem> element met subelementen aanmaken
//
beforeNode = xmlData.childNodes[nodeTeller].firstChild;
trace("BEFORE NODE: "+beforeNode);
trace(" ");
node = xmlData.createElement("XXX");
xmlData.childNodes[nodeTeller].insertBefore(node, beforeNode);
trace(xmlData);