xml to xml XSLT tarnsformation




Input XML
============================================
<SOURCE TransactionId="1" ProviderName="ABCDD"><RESPONSE><![CDATA[<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://ift.tt/18hkEkn" xmlns:xsi="http://ift.tt/ra1lAU" xmlns:xsd="http://ift.tt/tphNwY"><soap:Body><NetworkResponse xmlns="http://www.example.com/"><NetworkResult>&lt;Network offering_id="13" transaction_id="2" submission_id="3" timestamp="20140828 16010683 GMT" customer_id="NETTest"&gt;
&lt;Network_List&gt;
&lt;Network_Info att0="Y" att1="N" att2="N" att3="Y" att4="Y"&gt;
&lt;SIM_DATA&gt;
&lt;SIM&gt;&lt;![CDATA[1100040101]]&gt;&lt;/SIM&gt;
&lt;/SIM_DATA&gt;
&lt;NetworkResponseInfo k_status="C"&gt;
&lt;KEY1&gt;269&lt;/KEY1&gt;
&lt;PARENTNODE&gt;
&lt;CHILDNODE1&gt;
&lt;KEY2&gt;XXXXXXX&lt;/KEY2&gt;
&lt;KEY3&gt;YYYYYYY&lt;/KEY3&gt;
&lt;/CHILDNODE1&gt;
&lt;CHILDNODE2&gt;
&lt;KEY4&gt;N&lt;/KEY4&gt;
&lt;KEY5&gt;I&lt;/KEY5&gt;
&lt;/CHILDNODE2&gt;
&lt;CHILDNODE3&gt;
&lt;KEY6&gt;1&lt;/KEY6&gt;
&lt;KEY7&gt;3&lt;/KEY7&gt;
&lt;/CHILDNODE3&gt;
&lt;/PARENTNODE&gt;
&lt;KEY8&gt;&lt;![CDATA[some image not visible]]&gt;&lt;/KEY8&gt;
&lt;KEY9&gt;N&lt;/KEY9&gt;
&lt;KEY10&gt;15&lt;/KEY10&gt;
&lt;/NetworkResponseInfo&gt;
&lt;/Network_Info&gt;
&lt;/Network_List&gt;
&lt;response_message_list transaction_status_code="000" transaction_status_text="Successful"/&gt;
&lt;/Network&gt;</NetworkResult></NetworkResponse></soap:Body></soap:Envelope>]]></RESPONSE></SOURCE>

OUTPUT XML:
<ns3:NetworkResponse>
<Networks_OF_List>
<NetCharSeq>
<Nrep>
<type>Some Image</type>
<data> Data Coming from KEY8 CDATA section</data>
</Nrep>
<Nrep>
<type>ANYTHING</type>
<data>VALUE INSIDE SIM CDATA</data>
</Nrep>
<NetDetail>
<MYKEY1>Value present inside KEY4</MYKEY1>
<MYKEY2>Value present inside KEY5</MYKEY2>
</NetDetail>
<SystemID>Value of KEY2</SystemID>
<SystemPath>Valuelue of KEY3</SystemPath>
</NetCharSeq>
</Networks_OF_List>
</ns3:NetworkResponse>


Q : how to find and iterate through all the nodes present under CDATA and those nodes are started by (<) and closed by (>) Q .How should I iterate over all the child nodes and get the values like in below child node I want to retrieve the value


No comments:

Post a Comment