> length doesn'tdo it 

 

I think matches.match.length() -- not matches.match.length -- should
give you the number of <match> tags.

 

- Gordon

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Daniel Thompson
Sent: Tuesday, November 28, 2006 12:56 PM
To: [email protected]
Subject: [flexcoders] Built-in way to determine the number of XML
elements

 

I'm trying to see if a response from the server is empty. So, in one
case I
end up with:

<root>
<matches/>
</root>

And in the other, I get:

<root>
<matches>
<match ... />
</matches>
</root>

Using this fancy E4X, how do I test for the different conditions? I
always
seem to be getting back an XMLList, be it empty or not. I can't imagine
I
have to iterate this and check that it's zero at the end, but length
doesn't
do it, and I can't check for null because I'm always getting an XMLList.

Thanks,
-DT

 

Reply via email to