#39881 [Opn->Fbk]: document() function failing for long names in path

From: Date: Tue, 19 Dec 2006 11:59:32 +0000
Subject: #39881 [Opn->Fbk]: document() function failing for long names in path
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106550@lists.php.net to get a copy of this message
ID: 39881 Updated by: chregu@php.net Reported By: dashiad at hotmail dot com -Status: Open +Status: Feedback Bug Type: XSLT related Operating System: Windows XP Professional PHP Version: 5.2.0 New Comment: Could it be, that the space in your path is the problem and not the "longness" of the filename? Sorry, no windows here to test... Previous Comments: ------------------------------------------------------------------------ [2006-12-19 11:03:47] dashiad at hotmail dot com Description: ------------ Hello, something strange is happening with the document() XSL function, and long directory (+8 characters) names. Scenarios: - Passing a non-existent file path to document() (no long names): Warning issued ("failed to load external entity") (Normal behaviour) - Passing an existent or non-existent file path to document() , using long names: No warning, and, if the file exists, nothing is fetched. - Passing an existent file path to document, using MSDOS equivalent to long names: Everything works as it should.Warning, or success. This is, i have to change: "C:/Archivos de programa/Apache Group/Apache/htdocs/test.xml" to "C:/Archiv~1/Apache~1/Apache/htdocs/test.xml" to make it work. Havent tested if the problem is still there if is the xml filename the one with long name. Following is the reproduce code: Reproduce code: --------------- /* PHP FILE.The path should be changed as needed.There are two lines, one with long and other with short names. */ <? $xml='<?xml version="1.0"?><b></b>'; $xsl='<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >'. '<xsl:template match="/">'. // '<xsl:copy-of select="document(\'C:/Archivos de programa/Apache Group/Apache/htdocs/test.xml\')" />'. '<xsl:copy-of select="document(\'c:/Archiv~1/Apache~1/Apache/htdocs/test.xml\')" />'. '</xsl:template></xsl:stylesheet>'; $xmlDoc=new DOMDocument(); $xmlDoc->loadXML($xml); $xslDoc=new DOMDocument(); $xslDoc->loadXML($xsl); $proc = new XSLTProcessor; $proc->importStyleSheet($xslDoc); // attach the xsl rules echo $proc->transformToXML($xmlDoc) ?> /* Sample test.xml (external entity).Could be whatever.*/ <?xml version="1.0"?> <z> <q> </q> </z> Expected result: ---------------- For clarity, i've not added xml headers.The expected result (using short names,it works): <?xml version="1.0"?> <z> <q> </q> </z> Actual result: -------------- When using long names... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD> <BODY></BODY></HTML> (ie:nothing) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39881&edit=1

« previous php.bugs (#106550) next »