Remove the Parent tag in xml using php
- by Wasim
I am facing a problem in editing a xml file.
<?xml version="1.0" encoding="UTF-8"?>
<urlset>
<url>
<loc>http://www.abc.com/</loc>
<lastmod>2010-04-17T17:23:57+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>
<url>
<loc>http://www.abc.com/</loc>
<lastmod>2010-04-17T17:23:57+00:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.50</priority>
</url>
</urlset>
I want to add one more set of records starting with <url> with its other tags, (i.e) "loc,lastmod,changefreq,priority" and than save the xml file.For adding the new record i need to remove the parent closing tag that is </urlset> and than add the rest of the records and close the main tag.
Can anyone please help me solving my problem.Thanks