Quantcast
Channel: SCN: Message List - SAP Manufacturing Integration and Intelligence (SAP MII)
Viewing all articles
Browse latest Browse all 4841

How to merge two XML files into a single one?

$
0
0

I have two separate SQL queries and I have to modify both outputs with XSLT transformations. After that I will have 2 .xml files that I have to join into a single .xml file. Is it possible to do that?

 

1st

 

<rowsets>

  <rowset>

    <head>

      <column align="center" width="70">col1</column>

      <column align="center" width="80">col2</column>

      <column align="center" width="90">col3</column>

    </head>

  </rowset>

</rowsets>

 

2nd

 

<rowsets>

  <rowset>

    <head/>

    <row id="1">

      <cell>1</cell>

      <cell>2</cell>

      <cell>3</cell>

    </row>

    <row id="2">

      <cell>11</cell>

      <cell>22</cell>

      <cell>33</cell>

    </row>

    <row id="3">

      <cell>a</cell>

      <cell>b</cell>

      <cell>c</cell>

    </row>

  </rowset>

</rowsets>

 

result

 

<rowsets>

  <rowset>

    <head>

      <column align="center" width="70">col1</column>

      <column align="center" width="80">col2</column>

      <column align="center" width="90">col3</column>

    </head>

    <row id="1">

      <cell>1</cell>

      <cell>2</cell>

      <cell>3</cell>

    </row>

    <row id="2">

      <cell>11</cell>

      <cell>22</cell>

      <cell>33</cell>

    </row>

    <row id="3">

      <cell>a</cell>

      <cell>b</cell>

      <cell>c</cell>

    </row>

  </rowset>

</rowsets>

 

I do not insist that this should be the fix format for input .xml files. The only thing that "columns" and "rows" will come from two separate sources.

 

Thx


Viewing all articles
Browse latest Browse all 4841

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>