on 04-01-2015 4:32 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tibor,
Below is the output i got.
[Tracer_2]<?xml version="1.0" encoding="UTF-8"?><Rowsets DateCreated="2015-04-05T23:22:05" EndDate="2015-04-03T11:10:27" StartDate="2015-04-03T11:10:27" Version="14.0 SP5 Patch 11 (Aug 27, 2014)">
<Rowset>
<Columns>
<Column Description="" MaxRange="100" MinRange="0" Name="col1" SQLDataType="1" SourceColumn="col1"/>
<Column Description="" MaxRange="100" MinRange="0" Name="col2" SQLDataType="1" SourceColumn="col2"/>
<Column Description="" MaxRange="100" MinRange="0" Name="col3" SQLDataType="1" SourceColumn="col3"/>
</Columns>
<Row>
<col1>1</col1>
<col2>2</col2>
<col3>3</col3>
</Row>
<Row>
<col1>11</col1>
<col2>22</col2>
<col3>33</col3>
</Row>
<Row>
<col1>a</col1>
<col2>b</col2>
<col3>c</col3>
</Row>
</Rowset>
</Rowsets>
Please find the image below to achieve this. Please note, I have used local variables to assign input xmls and repeat through it. Repeater_0 for Headers and Repeater_1 for body.
Kindly ignore Doc_0 here, it's for another purpose. Document_1 is what we are focussing on.
Please note, you would not be able to see columns as those are dynamically created. Still you can map it as shown above.
Hope this helps.
Best Regards,
Swaroop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tibor,
Union would not help you here. You will have to create an XML doc and append columns and rows to it using a repeater.
Best Regards,
Swaroop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tibor,
Try using the MII Union action block . See the documentation here:
https://help.sap.com/saphelp_mii122sp01/helpdata/en/44/76cd6333003abee10000000a155369/content.htm
Regards,
Anushree
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.