khalid taha

khalid taha

  • NA
  • 12
  • 13.2k

to add empty xmlns to nodes

Nov 13 2013 2:44 AM
i have an xml

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:p1="http://www.w3.org/2001/XMLSchema-instance">
  <Body>
    <reinstateAccountRequest xmlns="http://abc.xyx/">
      <serviceRequestContext>
        <a>t</a>
        <b>t</b>
      </serviceRequestContext>
      <reinstateAccountInput>
        <a>t</a>
        <b>t</b>
      </reinstateAccountInput>
    </reinstateAccountRequest>
  </Body>
</Envelope>

i want to add empty xmlns to serviceRequestContext and reinstateAccountInput node

Resultant xml should look like below

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:p1="http://www.w3.org/2001/XMLSchema-instance">
  < Body>
    <reinstateAccountRequest xmlns="http://abc.xyx/">
      < serviceRequestContext xmlns="">
        < a>t</a>
        <b>t</b>
      < /serviceRequestContext>
      < reinstateAccountInput xmlns="">
        < a>t</a>
        < b>t</b>
      < /reinstateAccountInput>
    < /reinstateAccountRequest>
  < /Body>
< /Envelope>

Is there any way to do this?


Answers (1)