Re: Merge 2 XML files using PHP 4

From: Date: Wed, 07 Apr 2004 16:18:51 +0000
Subject: Re: Merge 2 XML files using PHP 4
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-182670@lists.php.net to get a copy of this message
Raditha Dissanayake wrote:
Gal wrote:
Hello all, Does anyone here add some good experience of writing PHP script which is merging 2 XML files.
Looks like this should go into an algorithms mailing list :-) in the mean time you might want to start looking at sax parser functions, and associated arrays in the php manual.
I will check the SAX functions. I know PHP very well. But I think that there is a lake of utilities and libs used in version 4. At least PHP 5 has the simple_xml module & better DOM XML support.
file 1: ========= <XML>
    <NODE name="aaa" value="old_value" />
    <NODE name="bbb" value="hello all" />
</XML> file 2: ========= <XML>
    <NODE name="aaa" value="NEW_value" />
    <NODE name="ccc" value="PHP_is_good" />
</XML> expected merge result: ======================= <XML>
    <NODE name="aaa" value="NEW_value" />
    <NODE name="bbb" value="hello all" />
    <NODE name="ccc" value="PHP_is_good" />
</XML>


« previous php.general (#182670) next »