ID:               36244
 User updated by:  maximgb at is-a dot ru
 Reported By:      maximgb at is-a dot ru
-Status:           Feedback
+Status:           Open
 Bug Type:         XSLT related
 Operating System: windows xp sp2
 PHP Version:      5.1.2
 New Comment:

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="&#1042;&#1086;&#1090; &#1090;&#1091;&#1090;
&#1085;&#1077; &#1076;&#1086;&#1083;&#1078;&#1085;&#1086;
&#1073;&#1099;&#1090;&#1100; XML
&#1089;&#1091;&#1097;&#1085;&#1086;&#1089;&#1090;&#1077;&#1081;" />
    </xsl:template>

</xsl:stylesheet>


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to