Re: [Flashcoders] E4X, it's STILL just not my day.

2010-02-18 Thread Muzak

the following works fine for me:

var artData:XML = art
bios
 artistBio f=Victor s=Pasmoreblah blah/artistBio
 artistBio f=Stephen s=Pentakmore blah blah/artistBio
/bios
/art;

var lastName:String = Pentak;
var firstName:String = Stephen;

var allBios:XMLList = artData.bios..artistBio;

var thisone:XMLList = allBios.((@s==lastName)(@f==firstName));

trace(thisone.toXMLString());


- Original Message - 
From: Mendelsohn, Michael michael.mendels...@fmglobal.com

To: Flash Coders List flashcoders@chattyfig.figleaf.com
Sent: Wednesday, February 17, 2010 10:26 PM
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=Pasmoreblah blah/artistBio
artistBio f=Stephen s=Pentakmore 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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] E4X, it's STILL just not my day.

2010-02-18 Thread Mendelsohn, Michael
Thanks for the replies, everyone.  I really have no idea how the solutions that 
everyone has responded with have worked when testing on your machine, but not 
here.  It's odd.  The statement isn't anything complicated.   I ended up using 
a for loop to iterate through and find the node I need.  That's my band aid 
solution, but the larger picture is that I am stumped how an E4x statement 
isn't working in this project.  Case closed for now I suppose.

- MM

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] E4X, it's STILL just not my day.

2010-02-18 Thread Merrill, Jason
((@s==lastName)(@f==firstName));

Seems to me the extra parentheses are not necessary, this works for me:

(@s==lastName  @f==firstName);

Just say'n.  Is there a technical reason for the extra parentheses or
just coding style?  Seems it evaluates the same either way in this case.
I can see if there were something more complex inside the parentheses
maybe it would be necessary...  just curious.

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)



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] E4X, it's STILL just not my day.

2010-02-18 Thread Mendelsohn, Michael
 just curious.

That's just my coding style, nothing more.

Every line of E4X I've written within this flp has acted funny.  I just don't 
get it, because I've written other more complex E4X statements, even with RegEx 
involved, that haven't given my any issues.  It's almost like it's the parser 
or something.

- MM

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] E4X, it's STILL just not my day.

2010-02-18 Thread Merrill, Jason
 It's almost like it's the parser or something.

Well, it seems what you're posting is an abstraction of the real code
and/or the real XML in your project (and good for you - too many [I
won't name names] post unnecessary code too often here)- so there must
be some difference in your actual code or actual XML which is causing
the issue. I would investigate that.  If you try the code we posted
which works, and it works for you, then you'll see it's not anything
funky like that.  Have you tried just the code samples we posted?  They
should work fine.


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)



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] E4X, it's STILL just not my day.

2010-02-17 Thread Mendelsohn, Michael
Hi list...

Why can't I get to the node I want to here:

art
bios
artistBio f=Victor s=Pasmoreblah blah/artistBio
artistBio f=Stephen s=Pentakmore 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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] E4X, it's STILL just not my day.

2010-02-17 Thread Merrill, Jason
I think you have overcomplicated it a little.  This works for me:

var artData:XML = new XML(art
bios
artistBio f=Victor s=Pasmoreblah blah/artistBio
artistBio f=Stephen s=Pentakmore 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: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] 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=Pasmoreblah blah/artistBio
artistBio f=Stephen s=Pentakmore 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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] E4X, it's STILL just not my day.

2010-02-17 Thread Glen Pike

If you hardcode the strings does it work?

I had a similar problem at work - not able to look now - but I found 
that casting in the test may help:


e.g.

artData.bios..artistBio.((@s==String(lastName))(@f==String(firstName)))






Mendelsohn, Michael wrote:

Hi list...

Why can't I get to the node I want to here:

art
bios
artistBio f=Victor s=Pasmoreblah blah/artistBio
artistBio f=Stephen s=Pentakmore 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
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

  


--

Glen Pike
01326 218440
www.glenpike.co.uk http://www.glenpike.co.uk

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders