You're probably getting an e4x error on the first empty node (because Attribute 
doesn't exist there).

Try to avoid this issue by using the "hasOwnAttribute" function to make sure 
that "Attribute" actually exists in that node.  This probably isn't it, but 
it's close:

xmlRoot..(hasOwnAttribute("Attribute"))

I'm not sure the above will work because we're not returning a specific level, 
but hopefully you get the idea.  Use the following URL for a great explanation 
of Advanced E4X:

http://joshblog.net/2007/06/29/getting-advanced-with-e4x/

Hope that helps...

--- In flexcoders@yahoogroups.com, <michael_regert@...> wrote:
>
> I must be missing something simple here.  I'm reading in XML that looks like 
> this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <REGISTRY>
>       <REGISTRY_DECLARATION/>
>       <REGISTRY_ENTRIES>
>             <Attribute>
>                   <AttributeName>Attr_1</AttributeName>
>             </Attribute>
>             <Attribute>
>                   <AttributeName>Attr_2</AttributeName>
>             </Attribute>
>             <Attribute>
>                   <AttributeName>Attr_3</AttributeName>
>             </Attribute>
>       </REGISTRY_ENTRIES>
> </REGISTRY>
> 
> I'm trying to get all <Atribute> nodes using the .. operator, but it always 
> returns 0, even though xmlRoot looks fine.
> 
> protected function xmlService_resultHandler(event:ResultEvent):void
> {
>       if (event != null && event.result != null && event.result is XML) {
>             var xmlRoot:XML = event.result as XML;
>             if (xmlRoot && xmlRoot.length() > 0) {
>                   var lst:XMLList = xmlRoot..Attribute;
>                   trace("lst length = " + lst.length());
>             }
>       }
> }
> 
> 
> Michael
>


Reply via email to