Copy XML nodes with DOM
Posted: Sun Jun 18, 2006 7:06 am
Hi, I'm a PHP 5 user, I've been using the DOM for a while, but now, I can't solve a problem.
The best way to explain is witn an example:
I have 2 XML documents:
Doc 1:
Doc 2:
I want the content of <two> inside <node>, but I don't want to copy the <two> tag, I want this:
So, I can't do it with ImportNode and AppendChild. I have no idea how to do it.
Can someone help me please?
Thank you very much.
The best way to explain is witn an example:
I have 2 XML documents:
Doc 1:
Code: Select all
<root>
<one />
<two>
Hello
<three>World</three>
</two>
</root>Code: Select all
<whatever>
<node />
</whatever>Code: Select all
<whatever>
<node>
Hello
<three>World</three>
</node>
</whatever>Can someone help me please?
Thank you very much.