FLEX读取带有xmlns命名空间的xml
带名字空间的XML
<?xml version="1.0" encoding="UTF-8"?><root version="1" xmlns="http://xspf.org/ns/0/"> <users id="user"> <user> <user_name name="zzz">张三</user_name> <user_age>23</user_age> <user_birth>1984-02-21</user_birth> <email>zhangsan@hotmail.com</email> </user> </users></root>
<?xml version="1.0" encoding="UTF-8"?><root version="1"> <users id="user"> <user> <user_name name="zzz">张三</user_name> <user_age>23</user_age> <user_birth>1984-02-21</user_birth> <email>zhangsan@hotmail.com</email> </user> </users></root>
var gXml:XML = XML(event.result);trace(gXml); //输出整个XMLvar ns:Namespace = new Namespace("http://xspf.org/ns/0/");trace(gXml.ns::users.ns::user.ns::user_name.toString()); //输出带名字空间的XMLtrace(gXml.users.user.user_name.toString()); //输出不带名字空间的XML