开发者

How to escape a colon when parsing XML in actionscript?

开发者 https://www.devze.com 2023-02-15 14:58 出处:网络
say I have XML like this: <root> <x:Item>test</x:Item> </root> How would I navigate to the x:Item node?

say I have XML like this:

<root>
  <x:Item>test</x:Item>
</root>

How would I navigate to the x:Item node?

I tried myXml..x:Item and myXml..x::Item but both throw errors. The first won't compile and the second complains about me trying to use NameSpace '0开发者_如何学运维'.


I ended up adding the namespace to my XML in my actionscript and that solved the issue. You can find the documentation here. The coded endedup looking like this:

var wNS:Namespace = new Namespace("w", "http://www.test.com/weather/");
myXmlMessage.addNamespace(wNS);


Just on top of my head...

myXML[0].Item
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号