The code applied to the (simplified) xml below gets me the node with myanim1.swf, as expected. I actually want the node with myanim3.swf. I would like to say "get the first node with a property tag with attribute name=animationUrl, but don't go deeper than one child". I currently have a work-around, but I'm looking for a more elegant solution.
This is ruby, and the object is a Nokogiri object. I believe this is XPath searching, but I'm a little unclear as to whether it is Nokogiri's flavor of XPath. Anyway, help appreciated, thanks.
XML:
<blah>
<property name="overlays">
<array>
<object type="myType">
<property name="animationUrl" value="myanim1.swf"/>
</object>
<object type="myType">
<property name="animationUrl" value="myanim2.swf"/>
</object>
</array>
</property>
<property name="animationUrl" value="myanim3"/>
</property>
</blah>
CODE:
myNode = thisNode.search("property[name=animationUrl]").first.andand["value"]