Quantcast
Viewing all articles
Browse latest Browse all 4841

Re: XML structure change

Hi Shashank,

  I am not sure about localization , however if you need the XML in the format you had mentioned then it is possible. All you need is a repeater, couple of assignment action block and 3 XMLs (Input, Output, and a subXML) and a  string variable to append your nodes.

 

1.  Logic, Repeat on source with XPATH : Local.InputXML{/Rowsets/Rowset/Row},

 

2.  assign its output to tempString ..

 

     From: Local.tempString

     To : Local.tempString & ("<"&Repeat_source_XML.Output{/Row/Name}&">"&Repeat_source_XML.Output{/Row/Value}&"              </"&Repeat_source_XML.Output{/Row/Name}&">")

 

3. Assign the tempString to a subXML.

 

     From: "<Row>"&Local.tempString&"</Row>"

 

      To: Local.subXMLToAppendRow

 

     You need this because you have to append each row to your output. Since the expression we are      writing is not an XML, MII does not allow us to append directly. Hence a work around.

 

4. Append the subXML to your OutputXML

 

    From: Local.subXMLToAppendRow

     To: Transaction.OutXML{/Rowsets/Rowset}

 

That is it.. you can put a tracer and check the result. It  may not look nice but it works Image may be NSFW.
Clik here to view.

 

InputXML:

<Rowset>

<Row>

<Name>MAKTX</Name>

<Value>12345</Value>

</Row>

<Row>

<Name>MATNR</Name>

<Value>Oloa Volace</Value>

</Row>

</Rowset>

</Rowsets>

Output XML (Initial):

<Rowsets>

<Rowset>

</Rowset>

</Rowsets>

Final Output XML

<Rowsets>

<Rowset>

<Row>

            <MAKTX>12345</MAKTX>

            <MATNR>Oloa Volace</MATNR>

        </Row>

    </Rowset>

</Rowsets>

 

I have attached a snapshot of my transaction.

 

Regards

Tufale Ashai


Viewing all articles
Browse latest Browse all 4841

Trending Articles



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