scala-xml : how to move child to another parent node

RobsonNLPT
Contributor III

Hi all

The mandatory rowTag for writing to XML cause doesn't make any sense as I have the complete nested dataframe schema.

In my case I need to implement an extra step to remove that extra node (default: Row) after xml generation.

I need some examples using scala-xml library and Transform/RuleTransformer/RewriteRule to move child to root parent and remove the node "Row" 

Any help?

 

 

 

Hi Kaniz. Thank you

Your code is not correct

command-3498107737134944:21: error: type mismatch; found : Seq[scala.xml.Node] required: scala.xml.Node def apply(xml: Node): Node = new RuleTransformer(this).transform(xml)

Can you check?

I just adapted the code and it worked. Thank you.

View solution in original post