note 63936 deleted from function.xslt-process by sobak

From: Date: Tue, 22 Nov 2016 03:38:33 +0000
Subject: note 63936 deleted from function.xslt-process by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-207386@lists.php.net to get a copy of this message
Note Submitter: ken at guest dot ie ---- After experiencing an ”xml declaration not at start of external entity” error with XML recieved from a remote server. The server now sends response headers back and these were getting in the way. This fixed it: $fp = fsockopen($queryhost, 80); if($fp) { fputs($fp, $header); while(!feof($fp)) { $xml .= fgets($fp, 128); } } fclose($fp); //ensure string starts with the XML declaration. $xml = substr($xml, strpos($xml, “<?xml”) ); $xsltproc = xslt_create(); $result = xslt_process($xsltproc,‘arg:/_xml’, $xsltfile, NULL, array(‘/_xml’ => $xml));

« previous php.notes (#207386) next »