There are a lot of different ways to convert json to xml, but the goal here is to produce the simplest xml possible given the particular collection.
XML element names would default to the type of collection. The elementNames arguments offer a way to name the elements at levels without keys (arrays). See the examples below for details.
There is no json representation for xml attributes.
If more customized xml is needed, then an iterative method (like _.each()) should be used instead.
There are a lot of different ways to convert json to xml, but the goal here is to produce the simplest xml possible given the particular collection.
XML element names would default to the type of collection. The
elementNames
arguments offer a way to name the elements at levels without keys (arrays). See the examples below for details.There is no json representation for xml attributes.
If more customized xml is needed, then an iterative method (like
_.each()
) should be used instead.Examples
Arrays:
Structs:
Arrays of Structs: