开发者

Actionscript 3 aaa namespace gets added

The following code results in nodes with "aaa" injected as the namespace. What is the correct way to convert from a ICollectionView to an XMLList without injecting a namespace?

The conversion to XMLList seems to create a default namespace called "aaa". This code is inside of a开发者_如何学编程 class that extends DefaultDataDescriptor.

I have this declaration at the top of this class, to be honest, I'm not sure why or when I added it, I still find namepsaces to be confusing:

var xns:Namespace = new Namespace("http://www.spicefactory.org/parsley");

I've already tried removeNamespace() on the XMLList, which didn't seem to have any effect. Thanks!

var x:XML =         
        <property xmlns="http://www.spicefactory.org/parsley" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="steps">
            <array>
                <object type="com.tn.assistant.models.Step">
                    <property name="id" value="2"/>
                    <property name="name" value="outro"/>
                </object>
            </array>
        </property>
        var chICollView:ICollectionView = getChildren(x);
        var chXMList:XMLList = XMLList (chICollView);

Resulting XMLList, chXMLList =

<aaa:object type="com.tn.assistant.models.Step" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aaa="http://www.spicefactory.org/parsley">
  <aaa:property name="id" value="2"/>
  <aaa:property name="name" value="outro"/>
</aaa:object>


Added this in my constructor, and it fixed it:

default xml namespace = xns;

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜