I am trying to come up with the best xml schema to support tag filtering. And then a method to filter the xml on an arbritary amount of tags. So here is the xml:
var videoXML:XML=
<?xml version="1.0" encoding="UTF-8"?>
<videos>
<video> <tags label="dogs,brown,lawns" /> </video>
<video> <tags label="dogs,cats" /> </video>
<video> <tags label="cats,lawns" /> </video>
</videos>
And the way I am filtering now is:
var filteredList:XMLList = videoXML..video.tags.(@label.indexOf("lawns") != -1 && @label.indexOf("dogs") != -1);
which would return only videos that had the tag "lawns" and "dogs", which is all good and fine.
But I want a method that I can pass in as many tags as I want and get the results of that filter.
Something like:
function getFilteredByTags(...tags):XMLList{
}
Any ideas on how to accomplish this?
Thanks!