locked
converting < and &gt of my xml file RRS feed

  • Question

  • You cannot vote on your own post                    
    0
                

    Hey I have a well formed xml which I need to converting < and &gt of my xml file like below ,

    Well formed schema :

    <batch_process><applicant><name last_name="BERMUDA DIGITAL COMMUNICATIONS" /><address><address_line1>5 Reid Street Kitson Building, 2nd Floor
    HAMILTON,HM 11
    BMU</address_line1><city>HAMILTON</city><postal_code>HM 11</postal_code><country country_code="BMU" /></address><phone>5637190327</phone><account_number>31000000840</account_number></applicant><applicant><name last_name="BLACKBERRY" /><address><address_line1>295 PHILLIP STREET
    WATERLOO,ONN2L 3W8
    CAN</address_line1><city>WATERLOO</city><state>ON</state><postal_code>N2L 3W8</postal_code><country country_code="CAN" /></address><phone /><account_number>31000000843</account_number></applicant><applicant><name last_name="BOOLCHAND PESSOOMAL (B.E) B.V" /><address><address_line1>Freezone Block D-I # 1
    Curacao
    ANT</address_line1><city>Curacao</city><country country_code="ANT" /></address><phone>5637190347</phone><account_number>31000000846</account_number></applicant><applicant><name last_name="AVADANIAN &amp; ASSOCIATES" /><address><address_line1>281 YOUNG HARRIS ST SUITE D PMB 273
    BLAIRSVILLE,GA30512
    USA</address_line1><city>BLAIRSVILLE</city><state>GA</state><postal_code>30512</postal_code><country country_code="USA" /></address><phone /><account_number>31000000830</account_number></applicant><applicant><name last_name="ADVANTAGE WIRELESS MIAMI" /><address><address_line1>2700 NW 72 ND AVE
    Miami,FL33122
    USA</address_line1><city>Miami</city><state>FL</state><postal_code>33122</postal_code><country country_code="USA" /></address><phone>5637190362</phone><account_number>31000000807</account_number></applicant><applicant><name last_name="AM WIRELESS URUGUAY S.A." /><address><address_line1>AVENIDA GENERAL SAN MARTIN 246
    MONTEVIDEO,URY</address_line1><city>MONTEVIDEO</city><country country_code="URY" /></address><phone>5637190367</phone><account_number>31000000817</account_number></applicant><applicant><name last_name="AEG WIRELESS, INC" /><address><address_line1>1923 MCDONALD AVE SUITE B
    BROOKLYN,NY11223
    USA</address_line1><city>BROOKLYN</city><state>NY</state><postal_code>11223</postal_code><country country_code="USA" /></address><phone>5637190381</phone><account_number>31000000808</account_number></applicant><applicant><name last_name="AMX PARAGUAY S.A." /><address><address_line1>AV. MARISCAL LOPEZ 1730
    ASUNCION,PRY</address_line1><city>ASUNCION</city><country country_code="PRY" /></address><phone>5637190391</phone><account_number>31000000821</account_number></applicant><applicant><name last_name="2P AGENCY USA, INC" /><address><address_line1>1674 EAST 22ND STREET 1ST FLOOR
    BROOKLYN,NY11229
    USA</address_line1><city>BROOKLYN</city><state>NY</state><postal_code>11229</postal_code><country country_code="USA" /></address><phone>5637190398</phone><account_number>31000000801</account_number></applicant><applicant><name last_name="BAHAMAS TELECOMMUNICATIONS CO." /><address><address_line1>BATELCO MARKETING DEPT.
    NASSAU
    BHS</address_line1><city>NASSAU</city><state>FL</state><postal_code>33054</postal_code><country country_code="BHS" /></address><phone>5637190403</phone><account_number>31000000832</account_number></applicant></batch_process>

    Need to convert this to:

            <S:Envelope xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'>
             <S:Body>
              <ns2:checkApplicants xmlns:ns2='http://webservice.sentinel.truthtechnologies.com/'>
               <arg0>USERNAME</arg0>
               <arg1>PASSWORD</arg1>
               <arg2>
           &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
           &lt;batch_process xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; &gt;
            xsi:noNamespaceSchemaLocation=&quot;applicantBatch.xsd&quot;&gt;
            &lt;userName&gt;USERNAME&lt;/userName&gt;
            &lt;applicant&gt;
             &lt;name first_name=&quot;JOHN&quot; middle_name=&quot;&quot; last_name=&quot;DOE&quot;/&gt;
             &lt;company_data&gt; &lt;company_name&gt;&lt;/company_name&gt;
              &lt;address&gt;
               &lt;address_line1&gt;&lt;/address_line1&gt;
               &lt;city&gt;&lt;/city&gt;
               &lt;state&gt;&lt;/state&gt;
               &lt;postal_code&gt;&lt;/postal_code&gt;
               &lt;country country_code=&quot;&quot;/&gt;
              &lt;/address&gt;
             &lt;/company_data&gt;
             &lt;account_number&gt;ACCOUNT123&lt;/account_number&gt;
            &lt;/applicant&gt;
            &lt;applicant&gt;
             &lt;name first_name=&quot;JANE&quot; middle_name=&quot;&quot; last_name=&quot;DOE&quot;/&gt;
             &lt;company_data&gt; &lt;company_name&gt;&lt;/company_name&gt;
              &lt;address&gt;
               &lt;address_line1&gt;&lt;/address_line1&gt;
               &lt;city&gt;&lt;/city&gt;
               &lt;state&gt;&lt;/state&gt;
               &lt;postal_code&gt;&lt;/postal_code&gt;
               &lt;country country_code=&quot;&quot;/&gt;
              &lt;/address&gt;
             &lt;/company_data&gt;
             &lt;account_number&gt;ACCOUNT456&lt;/account_number&gt;
            &lt;/applicant&gt;
            &lt;applicant&gt;
             &lt;name first_name=&quot;?&quot; middle_name=&quot;&quot; last_name=&quot;?&quot;/&gt;
             &lt;company_data&gt; &lt;company_name&gt;&lt;/company_name&gt;
              &lt;address&gt;
               &lt;address_line1&gt;&lt;/address_line1&gt;
               &lt;city&gt;&lt;/city&gt;
               &lt;state&gt;&lt;/state&gt;
               &lt;postal_code&gt;&lt;/postal_code&gt;
               &lt;country country_code=&quot;&quot;/&gt;
              &lt;/address&gt;
             &lt;/company_data&gt;
             &lt;account_number&gt;ACCOUNT456&lt;/account_number&gt;
            &lt;/applicant&gt;
           &lt;/batch_process&gt;
               </arg2>
              </ns2:checkApplicants>
             </S:Body>
            </S:Envelope>


    ashwin

    Thursday, July 30, 2015 6:36 PM

Answers