I think it's yourNode.appendChild(newNode), off the top of my head.
Personally I'd prefer that to concatinating (love that word!) strings.
 
 
 
-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Nate Pearson
Sent: 16 April 2008 17:17
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Building XML out of an Array Collection
 
I gotcha! So what about adding children to that xml node? Do you
treat it just like a string or something? so If I wanted to add a
child to that node would it be something like this:

var newNode:XML = <myNode label={yourCollection[n]["label"]} id={
yourCollection[n]["id"]}>

newNode = newNode + <myNode label={yourCollection[n]["label"]} id={
yourCollection[n]["id"]}/>

I thought I saw some method called append in xml. I was hoping I
could create XMLNode(s) and do something like
newNode.append(myNewXMLNode)

thanks for responding so fast!

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Jim Hayes" <[EMAIL PROTECTED]> wrote:
>
> You can write the values straight into the xml notation using curly
> brackets : something like
> 
> var newNode:XML = <myNode label={yourCollection[n]["label"]} id={
> yourCollection[n]["id"]}/>
> 
> not sure I have the arrayCollection syntax correct, but hopefully you
> can see what I mean?
> 
> -----Original Message-----
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Nate Pearson
> Sent: 16 April 2008 16:59
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Building XML out of an Array Collection
> 
> I'm trying to change an array collection of typed objects from a .NET
> webservice into XML.
> 
> My array collection is like this:
> 
> myNode{
> label:String
> id:int
> children:ArrayCollection
> }
> 
> The items in the children array collection are more of "myNode".
> 
> I want to put it into xml so it looks like this:
> 
> <myNodes>
> <myNode label="test1" id="1"/>
> <myNode label="test2" id="2">
> <myNode label="test3" id="3"/>
> <myNode label="test4" id="4"/>
> <myNode label="test5" id="5"/>
> </myNode>
> <myNode label="test6" id="6"/>
> </myNodes>
> 
> I always work with arraycollections and never with xml, but this
> situation requires it. I just need to know how to start. I can loop
> through my arraycollection tree if I just know how to do a node or
two.
> 
> THANKS! :)
> 
> Nate
> 
> 
> __________________________________________________________
> This communication is from Primal Pictures Ltd., a company
registered in England and Wales with registration No. 02622298 and
registered office: 4th Floor, Tennyson House, 159-165 Great Portland
Street, London, W1W 5PA, UK. VAT registration No. 648874577.
> 
> This e-mail is confidential and may be privileged. It may be read,
copied and used only by the intended recipient. If you have received
it in error, please contact the sender immediately by return e-mail or
by telephoning +44(0)20 7637 1010. Please then delete the e-mail and
do not disclose its contents to any person.
> This email has been scanned for Primal Pictures by the MessageLabs
Email Security System.
> __________________________________________________________
>
 

______________________________________________________________________
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
______________________________________________________________________

Reply via email to