Home » » How to do XML Manupulation?

How to do XML Manupulation?

Written By M.L on திங்கள், 24 அக்டோபர், 2011 | அக்டோபர் 24, 2011

I have a XML  which  need to be manipulated in such a manner that remove current parent node and add other parent node.

For example  Original Xml is : -


<Envelope>
<Body>
  <ns0:Message xmlns:ns0="http://Test/Xml/1.0"               
               xmlns:ns5="http://Test/xml/client/3.0">
    <ns0:tInput>
      <ns0:ProcessInfo>
        <ns5:TrackingID>XYZ</ns5:TrackingID>
        <ns5:Origin>Test</ns5:Origin>
        </ns0:ProcessInfo>
      </ns0:tInput>
  </ns0:Message>
</Body>
</Envelope>

Yellow part of the XML has to remove and add new parent node (mentioned in bright green in lower XML)

After manipulation it would be looked like : -

<soapenv:Test xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Header/>
    <soapenv:Body>
      <ns0:Message xmlns:ns0="http://Test/Xml/1.0"
                     xmlns:ns5="http://Test/xml/client/3.0">
        <ns0:tInput>
          <ns0:ProcessInfo>
            <ns5:TrackingID>XYZ</ns5:TrackingID>
            <ns5:Origin>Test</ns5:Origin>
          </ns0:ProcessInfo>
        </ns0:tInput>
      </ns0:Message>
    </soapenv:Body>
</soapenv:Test>

0 comments:

கருத்துரையிடுக

Popular Posts

General Category