working for me. here is the code I used for testing:
package
{
import flash.display.Sprite;
public class Test extends Sprite
{
private var xmlRoot:XML =
<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>;
public function Test()
{
if (xmlRoot && xmlRoot.length() > 0) {
var lst:XMLList = xmlRoot..Attribute;
trace("lst length = " + lst.length());
}
}
}
}
it outputs 'lst length = 3' as expected.
Haykel Ben Jemia
Allmas
Web & RIA Development
http://www.allmas-tn.com
On Thu, Sep 22, 2011 at 3:54 PM, <[email protected]> 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*****
>
> ** **
>
>
>