For a XML snippet like this:
val fruits = <fruits> <fruit> <name>apple</name> <taste>red</taste> </fruit> <fruit> <name>banana</name> <taste>yellow</taste> </fruit> <fruit> <name>banana</name> <taste>green</taste> </fruit> <fruit> <name>apple</name> <taste>green</taste> </fruit> </fruits> doing something like:
fruits \\ "fruit" will return a sequence of type scala.xml.NodeSeq with all the fruits and sub nodes inside.
How can I limit this sequence to contain only the fruit elements with 'banana' inside. ie, I want the result to be:
<fruits> <fruit> <name>banana</name> <taste>yellow</taste> </fruit> <fruit> <name>banana</name> <taste>green</taste> </fruit> <fruits>
<fruit>tags in your expected output don't match up.