0
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<Document xmlns='urn:iso:std:iso:20022:tech:xsd:pain.001.001.02'>
    <books>    
        <book>
        <qty>12</qty>
        <title>C++</title>
        </book>
        <book>
        <qty>21</qty>
        <title>PHP</title>
        </book>    
      </books>    

      <books>    
        <book>
        <qty>25</qty>
        <title>Java</title>
        </book>    
        <book>  
        <qty>32</qty>
        <title>Python</title>
        </book>
        <book>  
        <qty>22</qty>
        <title>History</title>
        </book>    
    </books>

  </Document>

How Can I Rename ?

<Document xmlns='urn:iso:std:iso:20022:tech:xsd:pain.001.001.02'>

TO

<Document>
hakre
  • 184,866
  • 48
  • 414
  • 792
kn3l
  • 18,459
  • 28
  • 85
  • 123

1 Answers1

1

here you don't rename, you remove an attribute. Maybe DomElement::removeAttribute (http://php.net/manual/en/domelement.removeattribute.php) will do the work BUT if he doesn't because xmlns defines a namespace try to redefine the default namespace to null.

Mathias E.
  • 471
  • 3
  • 5