XML : How to check if NodeSeq contains a particular element

I tried using "contains" function which is supposed to give a boolean if the nodeSeq contains an element, but its not working for me.

For example: seq =

  <parent>    <child1 />    <child2 />  </parent>    

If I use seq.contains("child1"), it gives me false. Am I missing something ?

No comments:

Post a Comment