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

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

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