cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

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

RobsonNLPT
Contributor II

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?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

2 REPLIES 2

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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group