Bug #14965 Updated: Sablotron XLST encoding error

From: Date: Thu, 10 Jan 2002 19:40:03 +0000
Subject: Bug #14965 Updated: Sablotron XLST encoding error
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76527@lists.php.net to get a copy of this message
ID: 14965 User updated by: andrew.stopford@btinternet.com Reported By: andrew.stopford@btinternet.com Status: Open Bug Type: Documentation problem Operating System: Windows 2000 PHP Version: 4.1.1 New Comment: slight correction to my last message it should read $file_path = "C:\\test\\"; :) Andrew Previous Comments: ------------------------------------------------------------------------ [2002-01-10 14:35:45] andrew.stopford@btinternet.com Hi, $DOCUMENT_ROOT is a blank variable also trying the file path rather than HTTP e.g. $file_path = "C://test//"; Produces the same error. All paths are correct Andrew ------------------------------------------------------------------------ [2002-01-10 14:21:41] hholzgra@php.net moved to "Documentation problem" ------------------------------------------------------------------------ [2002-01-10 14:21:06] hholzgra@php.net your problem is $file_path = "http://localhost/test/"; change it to $file_path = "$DOCUMENT_ROOT/test/"; sablot will read from local filesystem only, while within the XML it's safe to have URLs as pathes ------------------------------------------------------------------------ [2002-01-10 14:14:19] andrew.stopford@btinternet.com Hi, I tried the following code. <?php //path $file_path = "http://localhost/test/"; //xml file $xml_file = $file_path . "people.xml"; //xsl file $xsl_file = $file_path . "people.xslt"; //open xml file $xmlfile = fopen ($xml_file, "r"); while (!feof ($xmlfile)) { $xml_file_contents = fgets($xmlfile, 4096); //echo $xml_file_contents; } fclose ($xmlfile); //open xslt contents $xslfile = fopen ($xsl_file, "r"); while (!feof ($xslfile)) { $xsl_file_contents = fgets($xslfile, 4096); //echo $xsl_file_contents; } fclose ($xslfile); $arguments = array( '/_xml' => $xml_file_contents, '/_xsl' => $xsl_file_contents ); // Allocate a new XSLT processor $xh = xslt_create(); // Process the document $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); xslt_free($xh); ?> The paths are correct as both files are displayed. Still the same error message. Changed the XML file to use a local file path for the DTD with no effect. Andrew ------------------------------------------------------------------------ [2002-01-10 12:02:19] msopacua@idg.nl You set the path as an http:// url. By default, Sablotron doesn't provide an http handler, nor does the current xslt extension. This also applies to external entities and dtd's. Use the arg:/_xml syntax and fetch the url's first (fopen or even better with the curl extension) => Should be documentation problem as the file open method is not specified and could be interpreted as the php fopen. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/?id=14965 Edit this bug report at http://bugs.php.net/?id=14965&edit=1

« previous php.dev (#76527) next »