ID: 36244 Updated by: [EMAIL PROTECTED] Reported By: maximgb at is-a dot ru -Status: Open +Status: Assigned Bug Type: XSLT related Operating System: windows xp sp2 PHP Version: 5.1.2 -Assigned To: +Assigned To: chregu New Comment:
Christian, is this some kind of libxml weirdness or ..? Previous Comments: ------------------------------------------------------------------------ [2006-02-01 21:58:44] maximgb at is-a dot ru In the bug2.xsl in bug message attribute should be some text in windows-1251 encoding. In previous comment it was encoded by bug tracker posting system. ------------------------------------------------------------------------ [2006-02-01 21:51:49] maximgb at is-a dot ru bug.php ------- <?php $source = new DOMDocument(); $source->load("bugsrc.xml"); $transform = new DOMDocument(); $transform->load('bug2.xsl'); $xslt = new XSLTProcessor(); $xslt->importStyleSheet($transform); file_put_contents("bugdest.xml", $xslt->transformToXML($source)); ?> bugsrc.xml ---------- <?xml version="1.0" encoding="windows-1251"?> <bug/> bug1.xsl -------- <?xml version="1.0" encoding="windows-1251"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="windows-1251" indent="yes" omit-xml-declaration="no" /> </xsl:stylesheet> bug2.xsl -------- <?xml version="1.0" encoding="windows-1251"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:import href="bug1.xsl"/> <!--<xsl:import href="bug1.xsl"/>--> <xsl:template match="bug"> <bug message="Вот тут не должно быть XML сущностей" /> </xsl:template> </xsl:stylesheet> ------------------------------------------------------------------------ [2006-02-01 11:16:54] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2006-02-01 11:14:41] maximgb at is-a dot ru Description: ------------ I have two stylesheets first one with xsl:output tag only, where method="XML" and encoding="windows-1251", second one which imports the first one and where all other templates are stored. When I use <xsl:import href='first.xsl' /> then all russian characters after transformation become XML entities, when I use <xsl:include href="first.xsl' /> then everything is ok. All XML files involved in transformation has following xml declaration <?xml version="1.0" encoding="windows-1251"?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36244&edit=1