scala - Removing nodes from XML -


i want produce xml document another, filtering subnodes match specified criterion. how should that?

you can use ruletransformer scala.xml.transform.

suppose have action attribute "remove" value

  val removeit = new rewriterule {     override def transform(n: node): nodeseq = n match {       case e: elem if (e \ "@action").text == "remove" => nodeseq.empty       case n => n     }   }  new ruletransformer(removeit).transform(yourxml)  

Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -