Break the up in pieces so you are sure you have valid nodes. i.e., pull the "after" node into is own variable and make sure it is valid. Also try with very simple child xml.
Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of jamiebadman Sent: Monday, March 12, 2007 12:33 PM To: [email protected] Subject: [flexcoders] Re: E4X Syntax Help required... Playing with this some more: myXML.insertChildAfter(myXML.*.(id==433), newXML); Seems to be getting closer... but still no joy ;-) Jamie. --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "jamiebadman" <[EMAIL PROTECTED]> wrote: > > Hi, > > I've been trying to figure out how to formulate the command required > to insert a child into an XML structure... > > I have the structure stored in myXML, the contents of which looks like > this: > > <global> > <ci type="CIGroup" id="433" name="User" parentId="-1" style="0"> > <ci type="CIGroup" id="204" name="john" parentId="433" style="1"/> > <ci type="CIGroup" id="238" name="SYNCHRONIZE_TEST" parentId="433" > style="1"/> > <ci type="CIGroup" id="240" name="SINAN" parentId="433" style="1"/> > <ci type="CIGroup" id="221" name="empty" parentId="433" style="1"/> > <ci type="CIGroup" id="358" name="JOHN_TEST" parentId="433" > style="1"/> > </ci> > </global> > > I have a new XML structure in newXML which looks like this: > > <ci type="CIGroup" id="999" name="FRED" parentId="433" style="1"/> > > I want to insert newXML in to myXML as a child node under 'User'. > > I've tried commands like: > > myXML.insertChildAfter(myXML.*.(@id=433), newXML); > > But with no joy... > > Can someone help with how I can achieve this ? Additionally, I'd > really like to get up to speed with how to use the E4X notation > properly in Flex, to traverse XML structures - can anyone recommend a > good resource, either on the web or a book - for learning about this ? > > Thanks, > > Jamie. >

