First, just build XML then use e4x expressions to return the XMLList that
you want.

 

“Create the equivalent string…” does not mean “static”.  You can dynamically
build your string that represents XML, using whatever run-time logic you
need, the pass that string to  the top-level XML() function, which returns
XML.

 

Alternatively, you can instantiate an XML node root, then use the XML API to
manipulate it:

var sMyVar:String = “attributevalue”;

var xml:XML = <myroot>;

var xmlNewNode:XML;

xmlNewNode = <node attrName={sMyVar} >;

xml.appendChild(xmlNewNode);

 

etc. 

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of thomas parquier
Sent: Friday, April 10, 2009 11:47 AM
To: [email protected]
Subject: Re: [flexcoders] Re: Create XML List by code

 






I think you can get an xml object from your xmllist and then use XML
methods, most of them returns xmllist.


thomas



2009/4/10 lehaianh1986 <lehaianh1986@ <mailto:[email protected]>
yahoo.com>

 

No, I can't use static string. Depend on my data, I will use regexp to sort
and classify items to some groups (like example I show). 
I think it like a dynamic tree and can be add or edit, etc...

So how do I do to create each element and add to XMLList, then add another
element to become children of the previous element?



--- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
Alex Harui <aha...@...> wrote:
>
> Create the equivalent string, then pass that into the constructor of
XMLList
> 
> Alex Harui
> Flex SDK Developer

> Adobe Systems Inc.<http://www.adobe. <http://www.adobe.com/> com/>


> Blog: http://blogs. <http://blogs.adobe.com/aharui> adobe.com/aharui
> 
> From: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com
[mailto:flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com]
On Behalf Of lehaianh1986
> Sent: Thursday, April 09, 2009 2:33 AM
> To: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com
> Subject: [flexcoders] Create XML List by code
> 
> 
> 
> 
> 
> Hi all,
> 
> I have XMLList like:
> 
> <mx:XMLList id="treeData">
> <node label="Mail Box">
> <node label="Inbox">
> <node label="Marketing"/>
> <node label="Product Management"/>
> <node label="Personal"/>
> </node>
> <node label="Outbox">
> <node label="Professional"/>
> <node label="Personal"/>
> </node>
> <node label="Spam"/>
> <node label="Sent"/>
> </node>
> </mx:XMLList>
> 
> But I want to create XML List by code, so how do I do?
>






-- 
http://www.web- <http://www.web-attitude.fr/> attitude.fr/
msn : thomas.parquier@ <mailto:[email protected]>
web-attitude.fr
softphone : sip:webattitude@ <mailto:sip%[email protected]> ekiga.net
téléphone portable : +33601 822 056



Reply via email to