cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Converting Dataframe into Nested xml

PriyaTech
New Contributor

e.g.

dataframe is having firstname,lastname,middlename,id,salary

I need to convert dataframe in xml file but in nested format.

output as nested xml

<Name>

    <firatname>

<middlename>

    <lastname>    

</Name>

<id></id>

<salary></salary>

Anyone has ides hot to achieve this.

1 ACCEPTED SOLUTION

Accepted Solutions

-werners-
Esteemed Contributor III

databricks has a xml connector:

https://docs.databricks.com/data/data-sources/xml.html

Basically you just define a df with the correct structure and write it to xml.

To create a nested df, here you can find some info.

View solution in original post

2 REPLIES 2

-werners-
Esteemed Contributor III

databricks has a xml connector:

https://docs.databricks.com/data/data-sources/xml.html

Basically you just define a df with the correct structure and write it to xml.

To create a nested df, here you can find some info.

Kaniz
Community Manager
Community Manager

Hi @Priyanka Jain​, We haven't heard from you on the last response from @Werner Stinckens​​, and I was checking back to see if his suggestions helped you. Or else, If you have any solution, please share it with the community as it can be helpful to others.

Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.