PHP: replace text in an xml node, keeping CDATA. How?
Posted: Tue Dec 01, 2009 9:13 pm
Please can someone show me how to replace the text in a XML document node.
For example we have this simple xml document:
I want to change the word 'Hello' to 'Goodbye'.
How do I do that in php? I'm completely stuck.
Please someone show me a simple way. I've googled for hours and can't find anyone talking in a straight manor about how to do this.
Thanks in advance.
For example we have this simple xml document:
Code: Select all
<?xml version="1.0"?>
<root>
<branch>
<leaf><![CDATA[Hello]]></leaf>
</branch>
</root>
I want to change the word 'Hello' to 'Goodbye'.
How do I do that in php? I'm completely stuck.
Please someone show me a simple way. I've googled for hours and can't find anyone talking in a straight manor about how to do this.
Thanks in advance.