RE: [flexcoders] Filtering descendant XML nodes based on multiple tag names

2008-04-19 Thread westmeadboy

I tried that but with no success.

If I do:

topElement.descendants().(hasOwnProperty(@id));

Then I get a long XMLList.

But if I do:

topElement.descendants().(hasOwnProperty(localName));

Then I get an empty XMLList.

I looked at the ECMA spec and they talk about accessing any property using
the [[propertyName]] convention. But I couldnt get that to work in this
expression...


Have you tried topElement.descendants().(localName ==X || localName ==
Y)  ?
Not able to check the exact syntax on that just now (is localName an
attribute???) , but I think that's worked for me before.
There was a post yesterday that seemed to be concerned with a similar sort
of thing, you may want to check that as well.

-- 
View this message in context: 
http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-tag-names-tp16760756p16767574.html
Sent from the FlexCoders mailing list archive at Nabble.com.



RE: [flexcoders] Filtering descendant XML nodes based on multiple tag names

2008-04-19 Thread westmeadboy

Thanks very much - works perfectly.


Tracy Spratt wrote:
 
 Almost all properties ain e4x are implemented as methods.  So you want
 localName().  Try:
 
 topElement.descendants.(localName() ==X || localName() == Y) ;
 
 Tracy
 

-- 
View this message in context: 
http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-tag-names-tp16760756p16782698.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Filtering descendant XML nodes based on multiple tag names

2008-04-18 Thread westmeadboy

I would like to get all descendants having a tag name of either X or Y. Can
this be done in one nice expression?

I want something like this: topElement..(X|Y) or topElement..(localName ==
X || localName == Y)

But neither of those seem to work.

At the moment I have to do topElement..* and then filter programatically.
-- 
View this message in context: 
http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-tag-names-tp16760756p16760756.html
Sent from the FlexCoders mailing list archive at Nabble.com.



RE: [flexcoders] Filtering descendant XML nodes based on multiple tag names

2008-04-18 Thread Jim Hayes
Have you tried topElement.descendants().(localName ==X || localName == Y)  ?
Not able to check the exact syntax on that just now (is localName an 
attribute???) , but I think that's worked for me before.
There was a post yesterday that seemed to be concerned with a similar sort of 
thing, you may want to check that as well.


-Original Message-
From: flexcoders@yahoogroups.com on behalf of westmeadboy
Sent: Fri 18/04/2008 07:50
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Filtering descendant XML nodes based on multiple tag names
 

I would like to get all descendants having a tag name of either X or Y. Can
this be done in one nice expression?

I want something like this: topElement..(X|Y) or topElement..(localName ==
X || localName == Y)

But neither of those seem to work.

At the moment I have to do topElement..* and then filter programatically.
-- 
View this message in context: 
http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-tag-names-tp16760756p16760756.html
Sent from the FlexCoders mailing list archive at Nabble.com.



__
This communication is from Primal Pictures Ltd., a company registered in 
England and Wales with registration No. 02622298 and registered office: 4th 
Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT 
registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read, copied and 
used only by the intended recipient. If you have received it in error, please 
contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 
1010. Please then delete the e-mail and do not disclose its contents to any 
person.
This email has been scanned for Primal Pictures by the MessageLabs Email 
Security System.
__winmail.dat

RE: [flexcoders] Filtering descendant XML nodes based on multiple tag names

2008-04-18 Thread Tracy Spratt
Almost all properties ain e4x are implemented as methods.  So you want
localName().  Try:

topElement.descendants.(localName() ==X || localName() == Y) ;

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jim Hayes
Sent: Friday, April 18, 2008 8:31 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Filtering descendant XML nodes based on
multiple tag names

 

Have you tried topElement.descendants().(localName ==X || localName ==
Y) ?
Not able to check the exact syntax on that just now (is localName an
attribute???) , but I think that's worked for me before.
There was a post yesterday that seemed to be concerned with a similar
sort of thing, you may want to check that as well.

-Original Message-
From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
on behalf of westmeadboy
Sent: Fri 18/04/2008 07:50
To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
Subject: [flexcoders] Filtering descendant XML nodes based on multiple
tag names


I would like to get all descendants having a tag name of either X or Y.
Can
this be done in one nice expression?

I want something like this: topElement..(X|Y) or topElement..(localName
==
X || localName == Y)

But neither of those seem to work.

At the moment I have to do topElement..* and then filter
programatically.
-- 
View this message in context:
http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-t
ag-names-tp16760756p16760756.html
http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-
tag-names-tp16760756p16760756.html 
Sent from the FlexCoders mailing list archive at Nabble.com.

__
This communication is from Primal Pictures Ltd., a company registered in
England and Wales with registration No. 02622298 and registered office:
4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W
5PA, UK. VAT registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read,
copied and used only by the intended recipient. If you have received it
in error, please contact the sender immediately by return e-mail or by
telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not
disclose its contents to any person.
This email has been scanned for Primal Pictures by the MessageLabs Email
Security System.
__

 



RE: [flexcoders] Filtering descendant XML nodes based on multiple tag names

2008-04-18 Thread Gordon Smith
 Almost all properties ain e4x are implemented as methods. 

 

The reason for this is so that they can't conflict with your XML data.
E.g., consider the problem if your XML tag had an attribute named
'localName.

 

Gordon Smith

Adobe Flex SDK Team

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Friday, April 18, 2008 2:18 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Filtering descendant XML nodes based on
multiple tag names

 

Almost all properties ain e4x are implemented as methods.  So you want
localName().  Try:

topElement.descendants.(localName() ==X || localName() == Y) ;

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jim Hayes
Sent: Friday, April 18, 2008 8:31 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Filtering descendant XML nodes based on
multiple tag names

 

Have you tried topElement.descendants().(localName ==X || localName ==
Y) ?
Not able to check the exact syntax on that just now (is localName an
attribute???) , but I think that's worked for me before.
There was a post yesterday that seemed to be concerned with a similar
sort of thing, you may want to check that as well.

-Original Message-
From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
on behalf of westmeadboy
Sent: Fri 18/04/2008 07:50
To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
Subject: [flexcoders] Filtering descendant XML nodes based on multiple
tag names


I would like to get all descendants having a tag name of either X or Y.
Can
this be done in one nice expression?

I want something like this: topElement..(X|Y) or topElement..(localName
==
X || localName == Y)

But neither of those seem to work.

At the moment I have to do topElement..* and then filter
programatically.
-- 
View this message in context:
http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-t
ag-names-tp16760756p16760756.html
http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-
tag-names-tp16760756p16760756.html 
Sent from the FlexCoders mailing list archive at Nabble.com.

__
This communication is from Primal Pictures Ltd., a company registered in
England and Wales with registration No. 02622298 and registered office:
4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W
5PA, UK. VAT registration No. 648874577.

This e-mail is confidential and may be privileged. It may be read,
copied and used only by the intended recipient. If you have received it
in error, please contact the sender immediately by return e-mail or by
telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not
disclose its contents to any person.
This email has been scanned for Primal Pictures by the MessageLabs Email
Security System.
__