AnsweredAssumed Answered

Keeping the order of xml tags under an element

Question asked by JaeEmans5311 on Jan 19, 2016
Latest reply on Feb 2, 2016 by JaeEmans5311

Hello,

 

Here's a sample of xml I'm working with

 

<root>
<hostID> (minOccurs 0, maxOccurs 1)
    <uid></uid> (minOccurs 0, maxOccurs unbounded)
    <name></name>(minOccurs 0, maxOccurs unbounded)
    <el3></el3>(minOccurs 0, maxOccurs unbounded)
    etc...
</hostID>
</root>

 

As you can see, any or all of the grandchildren tags can not exist, or can exist multiple times.

 

In the case of this input data:
<uid>123</uid>
<name>ABC</name
<el3>example 1</el3>
<uid>456</uid>
<name>DEF</name
<el3>example 2</el3>

 

The output data would be
<uid>123</uid>
<uid>456</uid>
<name>ABC</name>
<name>DEF</name
<el3>example 1</el3>
<el3>example 2</el3>

 

Is there anyway to retain the consecutive order? It seems like the mapping loops and outputs per tag instead of doing the whole block in order.

 

Thanks!
-Jae

Outcomes