Skip to content

Instantly share code, notes, and snippets.

@soc
Created May 27, 2012 20:06
Show Gist options
  • Select an option

  • Save soc/2815695 to your computer and use it in GitHub Desktop.

Select an option

Save soc/2815695 to your computer and use it in GitHub Desktop.
package example.dynamicxml
object Main extends App {
val testXml = <test><foo><bar qux = "xyz">abc</bar></foo></test>
println((testXml \ "foo" \ "bar").text)
println((testXml \ "foo" \ "error").text)
println("==> " + DynamicXML(testXml).foo.bar.text)
println(DynamicXML(testXml).foo.error.text)
println(DynamicXML(testXml).foo.bar("qux"))
println(DynamicXML(testXml).foo.bar.@@.qux.text)
println(DynamicXML(testXml).foo.bar.attribute.qux.text)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment