ID: 14965 Comment by: [EMAIL PROTECTED] Old Reported By: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Documentation problem Operating System: Windows 2000 PHP Version: 4.1.1 New Comment:
On Windows 98, Apache 1.3.22, PHP 4.1.1, Sablotron 0.71, I experienced the same problem with 'xslt_process()', which I was able to solve using the 'file://' specifier: $result = xslt_process($xh, 'file://E:/Web/test.xml', 'file://E:/Web/test.xsl'); Strange enough, since the command: $result = xslt_process($xh, 'test.xml', 'test.xsl'); runs just fine on FreeBSD 4.4, Apache 1.3.22, PHP 4.1.1, Sablotron 0.71. On Windows however, the above command gives me error code 4: cannot open file 'd:/programs/apache/test.xsl' because Sablotron is looking for the xsl file in the Apache program directory. After specifying the full file name for the xsl file: $result = xslt_process($xh, 'test.xml', 'E:/Web/test.xsl'); I receive error code 63: unknown encoding '' After using the 'file://' prefix for the xsl file and a full file name for the xml file, I receive error code 2: XML parser error 9: junk after document element Only when using the 'file://' prefix for both the xsml and xsl file, xslt_process() seems to work fine for Windows: $result = xslt_process($xh, 'file://E:/Web/test.xml', 'file://E:/Web/test.xsl'); See also: http://archive.gingerall.cz/archives/sablot/msg01858.html HTH, Freddy Vulto Previous Comments: ------------------------------------------------------------------------ [2002-01-10 14:40:03] [EMAIL PROTECTED] slight correction to my last message it should read $file_path = "C:\\test\\"; :) Andrew ------------------------------------------------------------------------ [2002-01-10 14:35:45] [EMAIL PROTECTED] 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] [EMAIL PROTECTED] moved to "Documentation problem" ------------------------------------------------------------------------ [2002-01-10 14:21:06] [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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 ------------------------------------------------------------------------ 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 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]