Re: modify xml before parse

From: Date: Wed, 28 Jun 2006 09:42:51 +0000
Subject: Re: modify xml before parse
References: 1 2  Groups: php.general php.general 
Request: Send a blank email to php-general+get-238771@lists.php.net to get a copy of this message
Hi Adam, Thank for your input. However search and replace the value such as <![CDATA[ù?¸€ü÷Œú"<ù?àù?؀Z4À„Ï]]> to empty string ? Try the code below , no successful. $xmlfile = "/home/gvintranet/datacraft/htdocs/properties/test_cdata.xml"; $xml = file_get_contents($xmlfile); $xml = preg_replace('/<HardwareVersion>[^(\\/HardwareVersion)]<\\/HardwareVersion>/', '<HardwareVersion><\/HardwareVersion>', $xml); fwrite(fopen($xmlfile, 'wb'), $xml); Thanks - weetat Adam Zey wrote:
weetat wrote:
Hi all, I need to read xml file before it was parsed by PHP DOM functions. The xml file have some encrypted value as shown below :
    <InstanceName><![CDATA[ù?¸€ü÷Œú"<ù?àù?؀Z4À„Ï]]></InstanceName>
Anybody have any suggestion how to do it ? Thanks. - weetat
$xmlfile = file_get_contents("http://urloffile.com/filename.xml"); I mean, that is what you asked, how to read the xml file... Regards, Adam Zey.


« previous php.general (#238771) next »