I have XML like this:
<a>
<b name = "d"value = "1"/>
<b name = "e"value = "2"/>
<b name = "f"value = "3"/>
</a>
I want to fetch the value where name is e. How can i do that in scala using XML library of scala (import scala.xml.XML)
I am trying something like this:
map{line=>{
val rec = line.toString.split("\\^")
var duration = XML.loadString(rec(4))
((duration\\"a"\\"b"\@"name").toString())
}}
But getting blank as output