I think you have overcomplicated it a little. This works for me:
var artData:XML = new XML(<art>
<bios>
<artistBio f="Victor" s="Pasmore">blah blah</artistBio>
<artistBio f="Stephen" s="Pentak">more blah
blah</artistBio>
</bios>
</art>);
var lastName:String = "Pentak";
var firstName:String = "Stephen";
var resultList:XMLList = artData.bios.artistBio.(@s==lastName &&
@f==firstName);
trace(resultList); //traces "more blah blah" as expected.
Jason Merrill
Bank of America Global Learning
Learning & Performance Solutions
Join the Bank of America Flash Platform Community and visit our
Instructional Technology Design Blog
(note: these are for Bank of America employees only)
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of
Mendelsohn, Michael
Sent: Wednesday, February 17, 2010 4:27 PM
To: Flash Coders List
Subject: [Flashcoders] E4X, it's STILL just not my day.
Hi list...
Why can't I get to the node I want to here:
<art>
<bios>
<artistBio f="Victor" s="Pasmore">blah blah</artistBio>
<artistBio f="Stephen" s="Pentak">more blah
blah</artistBio>
</bios>
</art>
var artData:XML represents the above correctly.
var lastName:String = "Pentak";
var firstName:String = "Stephen";
// successfully lists out all the <artistBio> tags
var allBios:XMLList = artData.bios..artistBio;
// thisone is null...why?? Aren't I filtering it correctly?
var thisone:XMLList =
artData.bios..artistBio.((@s==lastName)&&(@f==firstName));
Thanks, perplexed, E4x shouldn't be this weird...
- Michael M.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders