Hi Guys,
I am pulling my hair out by this point, hope someone can help...
I am trying to update a single xml text node via xml dom, but can't get it no matter what...
Here's the php I have:
$xml = new DOMDocument('1.0');
$xml->load('system.xml');
$element = $xml->getElementsByTagName('status');
$newElement = $xml->createTextNode('published');
$element->replaceChild($newElement, $element);
$xml->save('ooo.xml');
system.xml sample:
<?xml version="1.0" encoding="utf-8"?>
<images>
<image>
<file>stairs</file>
<dir>../images/slideshow/</dir>
<status>published</status>
</image>
<image>
<file>flower</file>
<dir>../images/slideshow/</dir>
<status>published</status>
</image>
I am pobably not telling php of the text nodes parents, but I find this dom xml really confusing...
I will also using simpleXML in the document so mabye u can show me how to convert simpleXML to dom.
If someone could give me code that works with some simple comments I would be forever grateful.