Skip to content

Instantly share code, notes, and snippets.

@marcel
Created May 7, 2009 19:02
Show Gist options
  • Save marcel/108277 to your computer and use it in GitHub Desktop.
Save marcel/108277 to your computer and use it in GitHub Desktop.
scala> val xml = <people>
| <person>
| <name>Ara</name>
| </person>
| <person>
| <name>Marcel</name>
| </person>
| </people>
xml: scala.xml.Elem =
<people>
<person>
<name>Ara</name>
</person>
<person>
<name>Marcel</name>
</person>
</people>
scala> xml \ "person" \ "name"
res0: scala.xml.NodeSeq = <name>Ara</name><name>Marcel</name>
scala> (xml \ "person" \ "name").map(_.text)
res1: Seq[String] = ArrayBufferRO(Ara, Marcel)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment