Yes, you use an e4x expression to return an XMLList.  A common issue
with attributes is that the "@attrName" syntax will error if ALL of the
nodes do not have that attribute. Instead use attribute("attrName").

 

So for your expression, it might be something like:

var xlNodes:XMLList = xmlData.node.(attribute("this").length() > 0 ||
attribute("that").length() > 0)

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 

________________________________

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of sandi.pond
Sent: Tuesday, February 10, 2009 11:18 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Logic in dataProvider

 

Hello all, I'm new to Flex and so full of questions ... Is there a way 
to use logic to determine a dataProvider for a list? By that I mean, I 
have 2 attributes in my XML nodes and one will always contain a value 
and the other will always not. For example,

<node this="" that"" />

And my XMLList may contain several nodes:

<node this="value" />
<node that"anothervalue" />
<node this="andanother" />

And then I have an <mx:List> that I'd like to display the attribute 
that has a value - either this or that. I've tried using the || 
statement but no luck yet. 

Thank you in advance.



Reply via email to