How can I merge/insert xml file
Posted: Sat Mar 31, 2007 4:36 pm
feyd | Please use
b.xml:
I want to have a new xml file: c.xml which looks like:
How can I get this c.xml file? Any help would be appreciated. Thank you all.
feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi everyone,
I am very new to XML and php, I have a question about insert/merge data to XML file.
Suppose I have two XML files: a.xml and b.xml.
a.xml:
[syntax="xml"]<persons>
<person id ="1">
<name>John</name>
<address>123</address>
</person>
</persons>b.xml:
Code: Select all
<persons>
<person id ="2">
<name>Sue</name>
<address>123</address>
</person>
</persons>I want to have a new xml file: c.xml which looks like:
Code: Select all
<persons>
<person id ="1">
<name>John</name>
<address>123</address>
</person>
<person id ="2">
<name>Sue</name>
<address>123</address>
</person>
</persons>feyd | Please use[/syntax]
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]