Re-order Data for XML

Hi guys, first post, for a first “problem” …
I have to say that it is months that I am reading the forum (without writing anything) to understand something more than this Dynamo.
Now I’m in the first serious job that involves the use of Dynamo …
I’ve created a script to export data to Excel, and so far everything is perfect …
After that … I need to have to export an XML format, and here I somehow succeeded in my intent but …
How do I sort the data in the XML file?
I’ll explain:
Right now, the exported XML file is structured like this

  • element id 1
  • element id 2
  • element id 3
  • element id […]
    Parameter A of item 1
    Parameter A of item 2
    Parameter A of item 3
    Parameter A of the element […]
    Parameter B of item 1
    Parameter B of item 2
    Parameter B of item 3
    Parameter B of the element […]

etc …
I would like to have a structured XML like this:

  • ID Element

    • parameter A
    • parameter B
    • parameter …
    • parameter Z (etc)
  • ID Element

    • parameter A
    • parameter B
    • parameter …
    • parameter Z (etc)
  • ID Element

Have you tried the LunchBox package? it has some useful xml nodes.

Sure! those who see in attached are LunchBox nodes :sweat_smile:

It’s hard to see anything in your attached pic. Try zooming in so text is visible before using the camera icon in the top right of Dynamo.

Assuming each list of elements and parameters is the same length, use List.Chop to chop the list into sublists. Then Transpose your list to group them as you’re requesting.


This is a big capture of my workspace…but i’don’t understand how reorder my XML :’(

Hi Davide,

I’m not sure I’ve exactly understood your problem, but please see if this could help.

xml1