0

How do I remove the hirearchy section from this xml using php. Below is the structure of the xml currently:

<xml>
    <hirearchy>
        hirearchy child nodes...
    <hirearchy/>
    <products>
        product child nodes...
    </products>
</xml>

I want to open the file with php, remove the hirearchy section and the save the xml file agains so it looks like this:

<xml>
    <products>
        product child nodes...
    </products>
</xml>
Ben Paton
  • 1,432
  • 9
  • 35
  • 59
  • 1
    Well you do that by programming. Please search SimpleXML remove node and you should find the answer. – hakre Jun 25 '13 at 10:36
  • Solved as per the other question using: $xml = simplexml_load_file('file.xml') or die('Error: Cannot create object'); unset($xml->hierarchy); $xml->asXML('feed.xml'); – Ben Paton Jun 25 '13 at 11:23

0 Answers0