Quantcast
Channel: Adobe Community : All Content - All Communities
Viewing all articles
Browse latest Browse all 290743

XML and E4x help please

$
0
0

var xml:XML=<data>

<nodes>

          <node>

                    <title>First title</title>

                    <category>good thing</category>

                    <category>fuzzy</category>

          </node>

 

          <node>

                    <title>Second title</title>

                    <category>sweet</category>

                    <category>good thing</category>

                    <category>organic</category>

          </node>

 

          <node>

                    <title>Third title</title>

                    <category>fuzzy</category>

                    <category>organic</category>

          </node>

</nodes>

</data>

 

 

Let's say I have this XML. I want to get a list of the list nodes that contain a fuzzy category. I thought this would work:

 

     var myList:XMLList=xml.nodes.node.(category=="fuzzy");

 

But that doesn't work. Because a given node might have multiple category nodes I thought I would need somethng like this:

 

     var myList:XMLList=xml.nodes.(node.(category=="fuzzy").length());

 

But that didn't work either. Anybody know how to do this?


Viewing all articles
Browse latest Browse all 290743

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>