views:

641

answers:

0

Hi all,

This is best explained using an example. I have an xml document that has namespace qualified elements. What I want to do is search the xmlList to see how many namespace qualifier elements and/or attributes there are. So for example

some text

So for the above xml doc the namespace xsi would have 1 node returned from a search for namespace qualifier elements with the namespace xsi. But the namespace 'notused' would return 0 elements as no nodes/attributes use it as it is only declared.

I have the below code but it is not working correctly and not returning anything at all.

ActionScript Code:

    var arrayScope:Array = node.inScopeNamespaces();                 
    for (var j:int = 0; j < arrayScope.length; j++)     
    {         
        var nsElement:Namespace = new Namespace(arrayScope[j].prefix, arrayScope[j].uri);
           //search node for use         
        var usageCount:XMLList = node.*.nsElement::*;         
        var n:int = usageCount.length();                        

         if (n > 0)           
          trace("Found"); 
}

Any points/ help would be great

Thanks

Jon