will that return it's immediate parent or the one all the way at the top?

so tempXMLList = courseList.klass.depts.dept.(name==needle).parent()

returns klass and not depts - right?

Thanks,
hoyt

--- In [email protected], "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> .parent() will return the parent node.
> 
> Tracy
> 
>  
> 
> ________________________________
> 
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of hoytlee2000
> Sent: Thursday, March 13, 2008 3:53 AM
> To: [email protected]
> Subject: [flexcoders] need help with XML predicate filtering
> 
>  
> 
> Hello,
> 
> I have an XML file which consists of a list of classes and it's
> attributes (teacher, length, category, etc., etc., ...) Classes can
> belong to different depts. I want to be able to grab all the classes
> and their attributes that are part of a certain dept. The dept nodes
> is a child of the class node. I can filter out the xml file to find
> all the nodes whose dept value equals the dept I am looking for, but I
> don't know how to return the main parent node.
> 
> here is the xml file :
> <klasses>
> <klass id="0">
> <title>klass A</title>
> <length unit="hr">1.5</length>
> <category>core</category>
> <depts>
> <dept>
> <name>art</name>
> </dept>
> <dept>
> <name>pe</name>
> </dept>
> <dept>
> <name>modeling</name>
> </dept>
> <dept>
> <name>animation</name>
> </dept>
> </depts>
> </klass>
> <klass id="1">
> <title>klass B</title>
> <length unit="hr">1.5</length>
> <category>core</category>
> <depts>
> <dept>
> <name>r and d</name>
> </dept>
> <dept>
> <name>td</name>
> </dept>
> <dept>
> <name>lighting</name>
> </dept>
> <dept>
> <name>matte painting</name>
> </dept>
> </depts>
> </klass>
> ...
> ...
> ...
> </klasses>
> 
> I get the xml file from:
> courseList = evt.result.klass
> 
> // I want to get all klass objects that has "art" as one of the
> dept.name nodes
> 
> var needle:String = "art"
> 
> I try using this predicate filter but it only returns a XMLLIst that
> consists of <name>needle</name>
> 
> tempXMLList = courseList.klass.depts.dept.(name==needle)
> 
> what I want returned is:
> <klass>
> ...
> ...
> ...
> </klass>
> <klass>
> ...
> ...
> ...
> </klass>
> ...
> ...
> ...
> 
> where inside <klass> ... </klass> at least one of the dept.name nodes
> is equal to "art"
> 
> I know it's probably simple but I can't seem to get the syntax right.
> I've looked at a lot of examples but they don;t make sense to me and
> most don't deal with anything deeper than a single level. I can't
> seem to find any good documentation on predicate filtering either. I
> appreciate any help, its kinda got me stuck from moving forward on
> this development project.
> 
> I am still a novice on all this stuff.
> 
> Thanks.
> 
> be well,
> Hoyt
>


Reply via email to