var noDeptEmployees:XMLList = employees.employee.(child("department") == <></>);

 

<></> is an empty XMLList.

 

- Gordon

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of coder_flex
Sent: Tuesday, June 27, 2006 2:53 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] e4x filtering elements without specified children

 

Hi,

Some days ago I had asked a question about filtering on child's
attribute for elements of
which some of those children are missing. the xml I used was:

var employees:XML =
<employees>
<employee name="joe mark">
<department id="id1"/>
<address city="miami" state="florida"/>
</employee>
<employee name="sandra morey">
<address city="san francisco" state="california"/>
</employee>
<employee name="mary dooley">
<department id="id1"/>
<address city="los angeles" state="california"/>
</employee>
</employees>

Note here that the second employee record doesnt have department
element at all.

Now I am trying to filter it the otherway around, ie., In the above
xml definition I want all the "employee" elements for which the
"department" child element is missing. Therefore I want the employee
with name "sandra morey" above.

I tried all these expressions to no avail:
var noDeptEmployees:XMLList = employees.employee.(child("department")
== null);
var noDeptEmployees:XMLList = employees.employee.(child("department")
== "");

var noDeptEmployees:XMLList = employees.employee.(department ==
null);//throws error.

var noDeptEmployees:XMLList =
employees.employee.(child("department")[EMAIL PROTECTED] == null);
var noDeptEmployees:XMLList =
employees.employee.(child("department")[EMAIL PROTECTED] == "");

What is the e4x _expression_ to get employee elements without department's.

thanks in advance for the answer.

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to