AnsweredAssumed Answered

Combine XML on root node?

Question asked by MattKnoop7631 on Dec 17, 2015
Latest reply on Dec 24, 2015 by MattKnoop7631

Hi,
Is it possible to merge XML documents that are follow the same profile? The data process combine documents does not allow me to select the root node. When I selected "conditions" as the element to use to combine the documents I lost the "header" node.

 

Thanks
-Matt

 

1st Doc
<?xml version="1.0" encoding="UTF-8"?>
<rootnode>
  <conditions>
    <item>
      <ITM_NUMBER>0000</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
  </conditions>
  </rootnode>

 

2nd Doc
  <?xml version="1.0" encoding="UTF-8"?>
<rootnode>
  <conditions>
    <item>
      <ITM_NUMBER>10</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
    <item>
      <ITM_NUMBER>10</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
  </conditions>
  <header>
    <DOC_TYPE>X</DOC_TYPE>
    <SALES_ORG>X</SALES_ORG>
    <PURCH_NO_C>X</PURCH_NO_C>
  </header>
</rootnode>

 

How I would like the document to look
  <?xml version="1.0" encoding="UTF-8"?>
<rootnode>
  <conditions>
    <item>
      <ITM_NUMBER>0000</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
    <item>
      <ITM_NUMBER>10</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
    <item>
      <ITM_NUMBER>10</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
  </conditions>
  <header>
    <DOC_TYPE>X</DOC_TYPE>
    <SALES_ORG>X</SALES_ORG>
    <PURCH_NO_C>X</PURCH_NO_C>
  </header>
</rootnode>

 

Here is what the document combine step returned
  <?xml version="1.0" encoding="UTF-8"?>
<rootnode>
  <conditions>
    <item>
      <ITM_NUMBER>0000</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
    <item>
      <ITM_NUMBER>10</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
    <item>
      <ITM_NUMBER>10</ITM_NUMBER>
      <COND_TYPE>X</COND_TYPE>
      <COND_VALUE>X</COND_VALUE>
      <CURRENCY>X</CURRENCY>
    </item>
  </conditions>
</rootnode>

Outcomes