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
Post a Comment