So I have a situation on my hands. I have an excel file that needs to be made into an XML file, which is a problem for a different posting (XSLT anyone?). That XML file is going to represent a list of about 400 items that are coded into about 15 different categories. Here is a sample of that XML:
<?xml version="1.0" encoding="UTF-8"?>
<hotel>
<hfloor number="18">
<d_location d_code="sw18.10N" d_type="sw" description="Ferbludgit thingamabob">
<d_image>3e_pic1</d_image>
<d_image>3e_pic2</d_image>
<d_image>3e_pic3</d_image>
<d_image>3e_pic4</d_image>
<d_image>3e_pic5</d_image>
<d_video>3e_vid_1</d_video>
<d_video>3e_vid_2</d_video>
<d_video></d_video>
</d_location>
</hfloor>
<hfloor number="15">
<d_location d_code="W3" d_type="sw" description="Broken fetzer valve">
<d_image>3s_pic1</d_image>
</d_location>
<d_location d_code="LB12" d_type="sw" description="Screwed up whosamadingy">
<d_image>media/lb15_12/LB-12 LOOKING NORTH.png</d_image>
<d_image>media/lb15_12/LB-12 LOOKING SOUTH.png</d_image>
<d_image>media/lb15_12/Pages from Level_15_Link_Beam_12.png</d_image>
<d_image>media/lb15_12/Pages from Level_15_Link_Beam_12-2.png</d_image>
<d_image>media/lb15_12/Post Demo from CITC018306365-2.png</d_image>
<d_image>media/lb15_12/Rebuilt from CITC018306365.png</d_image>
<d_image>media/lb15_12/WEI LB 12 level 15.png</d_image>
<d_video>Video 1</d_video>
<d_video>Video 2</d_video>
<d_video>Video 3</d_video>
</d_location>
<d_location d_code="LB17" d_type="sw" description="Broken fetzer valve">
<d_image>3s_pic1</d_image>
</d_location>
</hfloor>
<hfloor number="s">
<d_location d_code="lbs.6e" d_type="sw" description="Whacked flogatron">
<d_image></d_image>
<d_image></d_image>
<d_image></d_image>
<d_image></d_image>
<d_image></d_image>
<d_video></d_video>
<d_video></d_video>
<d_video></d_video>
</d_location>
</hfloor>
<hfloor number="s2">
<d_location d_code="W1" d_type="sw" description="Broken fetzer valve">
<d_image>3s_pic1</d_image>
</d_location>
<d_location d_code="SWS2.3" d_type="sw" description="Whacked flogatron">
<d_image>media/sw_s2_3/CITC000155966.png</d_image>
<d_image>media/sw_s2_3/CITC000155983.png</d_image>
<d_image>media/sw_s2_3/CITC000155996.png</d_image>
<d_image>media/sw_s2_3/CITC000156003.png</d_image>
<d_image>media/sw_s2_3/Screen shot 2012-04-19 at 5.54.42 PM.png</d_image>
<d_image>media/sw_s2_3/WEI SWS2.3.png</d_image>
<d_video>lbs.6e vid</d_video>
<d_video></d_video>
<d_video></d_video>
</d_location>
</hfloor>
</hotel>
The user needs to be able to view all of these in a list – no problem, though that will be a big scroller – but also to FILTER that list by the d_type in the code above. As mentioned, there are 15 of these types, and the user wants 15 radio buttons, one for each, that will re-build the list showing just the selected d_type.
Does anyone have any thoughts as to how to do this? Both the filtering algorithms and how to properly implement it in AS3? I assume I will need to create a second XML object of some sort and translate in the newer, sorted data.
You should just be able to filter your XML using the XML and XMLList classes.
An excellent overview of that is here: http://joshblog.net/2007/05/08/methods-to-filter-data-with-e4x-in-flash-9/