Aaron Smith wrote:
> I am looking for a solution for loading an xml file. then put it into an 
> object. then after editing a bunch of values in that object, put it back 
> to xml.

I'm a big fan of Ted's (of powersdk) XML path resolver. You can find it 
here:

http://www.powersdk.com/ted/2004/12/xml-resolver-105-f7-compatibility.php

tinurl: http://tinyurl.com/oc7vm

It allows you to stay in XML, but use array-like access to the data.

example:

#include "XML_Path_Resolver_v1_5.as"

x = new XML("<a>blah<t/><t>Hello World</t><t age='1'/></a>")

//GET REQUESTS
trace(x.a)
<a>blah<t /><t>Hello World</t><t age="1" /></a>

trace(x.a.t[2]) 
<t age="1" />

trace(x.a.t[2].attributes.age)  
1

trace(x.a._value)       
blah

trace(x.a.t[1]._value)  
Hello World

trace(x.a.t[2].attributes)
[type Object]

trace(x.a._node)
<a>blah<t /><t>Hello World</t><t age="1" /></a>

trace(x.a.t[1]._node)
<t>Hello World</t>

//SET REQUESTS
x.a._value = "blah22"                           
x.a.t[1]._value = "Hellllo World"       
x.a.t[2]._value = "222 World"           
x.a.t[0]._attr.dog = "fido"             
x.a.t[2]._attr.age = 34                         
x.a._node = "<superNode/>"              
x.a.t[0]._node = "<subtNode/>"          


trace(x);               
<a>blah22<t dog="fido"><subtNode /></t><t>Hellllo World</t><t 
age="34">222 World</t><superNode /></a>

j


-- 
Jos Yule
Digital Hyakugei

"Machines take me by surprise with great frequency."
- Alan Turing

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to