ID: 17779 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: DOM XML related Operating System: Windows 2000 PHP Version: 4.2.1 New Comment:
DOMXML does not resolve system entities, here is example: I use Apache 1.3.26 and PHP 4.2.3 as apache module on Linux, xml l10n.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE l:i18n SYSTEM "l10n.dtd" [ <!ENTITY ru SYSTEM "ru.xml"> <!ENTITY en SYSTEM "en.xml"> ]> <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> &ru; &en; </l:i18n> and stylesheet which just prints this xml out: ... <xsl:param name="l10n.xml" select="document('../l10n/l10n.xml')"/> ... <xsl:copy-of select="$l10n.xml"/> ... I expected that the ouput will be with resolved entities, but it is not and it prints just: <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> &ru; &en; </l:i18n> whithout any warning or errors. Previous Comments: ------------------------------------------------------------------------ [2002-09-14 06:51:55] [EMAIL PROTECTED] The problem lies with both Windows (any apache version) and Apache 2 on other systems. On windows at least, the current working directory for libxml2 calls ends up being the apache directory. See also bug 17390 (this bug is also a windows problem and not just Apache 2). The example in this bug report works for loading the file as the file is passed in as file('test.xml') rather than just the filename. getcwd() will return the correct working directory as well. The problem is that the file functions (including DTD references) the domxml extension uses, are directly from libxml2, which when loaded in the mentioned environments is loaded with apache and its working directory being the apache directory. Am unsure about a fix for this unless the current working directory can be set via libxml2 calls. Have yet to find if this is possible. Have only confirmed this using php as an apache module. ------------------------------------------------------------------------ [2002-08-14 12:24:11] [EMAIL PROTECTED] I use Apache 1.3.20 with PHP run as CGI ------------------------------------------------------------------------ [2002-08-14 12:22:09] [EMAIL PROTECTED] Hi do you use apache 1.3 or apache2? chregu ------------------------------------------------------------------------ [2002-06-18 09:36:03] [EMAIL PROTECTED] echo getcwd() gives me correct path, DOMXML still throws a warning, i wrote before (both with and without DOMXML_LOAD_COMPLETE_ATTRS) ------------------------------------------------------------------------ [2002-06-18 05:55:17] [EMAIL PROTECTED] Works fine for me with Linux, both the Apache module and CGI version. I think that the WIndows thing doesn't change to the correct working directory. Can you try this by putting an "echo getcwd()" just before the call to xmldoc(). Derick ------------------------------------------------------------------------ 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/17779 -- Edit this bug report at http://bugs.php.net/?id=17779&edit=1