Me gustaría ver una reescritura de guiones de abajo usando http://anti-xml.org en lugar de Scala XML.Un ejemplo de procesamiento xml pero usando anti-xml en lugar de Scala xml
Este es un extracto del capítulo 10. XML que reúne en Scala - http://ofps.oreilly.com/titles/9780596155957/HerdingXMLInScalaDSLs.html
// code-examples/XML/reading/pattern-matching-script.scala
import scala.xml._
val someXML =
<sammich>
<bread>wheat</bread>
<meat>salami</meat>
<condiments>
<condiment expired="true">mayo</condiment>
<condiment expired="false">mustard</condiment>
</condiments>
</sammich>
someXML match {
case <sammich>{ingredients @ _*}</sammich> => {
for (cond @ <condiments>{_*}</condiments> <- ingredients)
println("condiments: " + cond.text)
}
}
Gracias
Un poco tarde pero ... ¡gracias! – Rodolfo
En anti-xml 0.3 y posterior, [\\ sí atraviesa en primer orden] (https://github.com/djspiewak/anti-xml/issues/49), así 'condiments \\ text' ahora funciona bien . – Steve