I\'m writing a tool to update some xml files (pom.xml in this case) with scala because the effort it would take in java is significantly higher than (in theory) it is with s
Using Scalate's Scuery CSS3 transforms and scala.xml.Elem#copy:
scala.xml.Elem#copy
val xml = 1.0-SNAPSHOT 2.0 new Transformer { $("dependency > version") { node => node.asInstanceOf[Elem].copy(child = Text(node.text.stripSuffix("-SNAPSHOT"))) } }.apply(xml)
yields
NodeSeq(1.02.0)