Comments on: More XML filtering with E4X in ActionScript 3 https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/ Archive of older blog posts written by Josh Tynjala about Flash, Flex, and ActionScript Wed, 26 Jun 2013 02:52:46 +0000 hourly 1 https://wordpress.org/?v=4.9.9 By: Ivan https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-16290 Tue, 30 Aug 2011 02:54:37 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-16290 Hi, first is really helpfull this article. I´m trying to do something like this

var searchResults:XMLList = xmlData.Rows;
searchResults = searchResults.( attribute(“id”) == 15 || attribute(“id”) == 16 );
This works but i have an Array with the id´s to search somebody know if exist something like the clause “IN” ( SQL ).

searchResults = searchResults.( attribute(“id”) IN [15,16] );

if somebody have an idea, I really appreciate.

]]>
By: Bart https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-14030 Tue, 19 Jul 2011 14:48:07 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-14030 You can do this with node-name’s too! Usefull if you want to filter a list based on the name’s of the node but want to allow more then one. Note this will mess-up if you have a local variable named ‘name’ (this confuses the scope).

var list:XMLList = myXML.children().(name() == 'nameA' || name() == 'nameB');

You could also combine it with an Array to make it really dynamic, but don’t forget to convert name() to a String! This is because it actually is something else, a QName or Object):

var allowedNodes:Array = ['nodeA', 'nodeB', 'nodeC'];
var list:XMLList = myXML.children().(allowedNodes.indexOf(name().toString() > -1));
]]>
By: Eric https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-10196 Mon, 23 May 2011 13:56:35 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-10196 HI, I am trying to do something like this:

[action script]

var filteredList:XMLList = new XMLList();
getUniqueValues2(attribute(“ctyName”),xmlTest, filteredList);

private function getUniqueValues2(value:Object, inputList:XML, outputList:XMLList):void
{
if(!inputList.contains(value))
{
outputList += value;
}
}

flash builder is telling me: Call to a possibly undefined method attribute.
Is there a way to pass an attribute in a funtion? Because when I use your system with:

tempListColl.source = xmlTest.descendants().(filteredName = removeDuplicate(attribute(“ctyName”), filteredName));

(removeDuplicate() being a carbon-copy of your addUniqueValues())

The filteredName XMLList has exactly what I want but the tempListColl is unusable. Or maybe I messed up my syntax somewhere.

Very nice tutorial by the way.

Regards,

]]>
By: 12 Very Helpful XML Related Tutorials In ActionScript - Ntt.cc https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1248 Mon, 01 Nov 2010 14:10:11 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1248 […] More XML filtering with E4X in ActionScript 3 […]

]]>
By: Josh Tynjala https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1247 Mon, 25 Oct 2010 16:33:36 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1247 newbie11, there’s no short-hand e4x to sort elements in XML that I know of. you can insert and remove elements, though, so it should be possible.

]]>
By: newbie11 https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1246 Mon, 25 Oct 2010 08:30:10 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1246 Hi,

very useful, thank you. I have a question though: Do you know if it’s possible to sort items alphabetically?

example:

<Peter/>
<Astrid/>
<John/>

return
<Astrid/>
<John/>
<Peter/>

]]>
By: Getting Advanced with E4X - Josh Talks Flash https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1245 Thu, 25 Feb 2010 00:54:34 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1245 […] Let's finish up with the sample XHTML document that I referenced in my second post about E4X. […]

]]>
By: Ignacio https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1244 Wed, 10 Feb 2010 16:38:55 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1244 One billion thanks man,

I was stuck in this project for a week because I couldn’t figure out how to obtain the specific information I wanted from the xml source!

Great work, I really appreciate your effort!

Ignacio

]]>
By: netan https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1243 Sat, 19 Dec 2009 16:01:21 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1243 Great thanks..

]]>
By: Josh Tynjala https://joshblog.net/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1242 Sat, 19 Dec 2009 06:10:28 +0000 http://www.zeuslabs.us/2007/05/17/filter-xml-data-with-e4x-in-flash-part-2/#comment-1242 Netan, I use the iG:Syntax Hiliter plugin. You believe you can use [xml][/xml] tags in your WordPress editor to embed XML.

]]>