From:             [EMAIL PROTECTED]
Operating system: Windows 2000
PHP version:      4.1.1
PHP Bug Type:     Sablotron XSL
Bug description:  Sablotron XLST encoding error

Dear Sirs,

I have come across an issue with the Sablotron XSLT extension. The issue is
similar to the issue reported to http://bugs.php.net/bug.php?id=14499
however my encoding has been set.

Using Windows 2000 Server SP 2, PHP 4.1.1 and IIS 5.0 I tested the
following code.

XML

<?xml version="1.0" encoding="UTF-8"?>
<PEOPLE>
        <PERSON>
                <NAME>Andrew</NAME>
        </PERSON>
</PEOPLE>

XSL

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:template match="/">
                <html>
                        <head/>
                        <body>
                                <xsl:apply-templates/>
                        </body>
                </html>
        </xsl:template>
        <xsl:template match="NAME">
                <span style="display:list-item; font-family:Arial">
                        <span style="display:list-item; font-family:Arial">
                                <xsl:apply-templates/>
                        </span>
                </span>
        </xsl:template>
</xsl:stylesheet>

PHP

<?

//path
$file_path = "http://localhost/";;

//xml file
$xml_file = $file_path . "people.xml";

//xsl file
$xsl_file = $file_path . "people.xslt";

// Allocate a new XSLT processor
$xh = xslt_create();

// Process the document
$result = xslt_process($xh, $xml_file, $xsl_file);

xslt_free($xh);

?>

>From this script the following error is returned:

Warning: Sablotron error on line 1: unknown encoding '' in
c:\stuff\xlst_transform.php on line 18

line 18 is the following

$result = xslt_process($xh, $xml_file, $xsl_file);

The following adapation of the XSL file also gives the same result.

<?xml version="1.0"?>
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:template match="NAME">
            <span style="display:list-item; font-family:Arial">
                <xsl:apply-templates/>
            </span>
    </xsl:template>
</xsl:stylesheet>

I also tested the code using Apache 1.3.22 under Windows 2000 server with
the same result.

Andrew Stopford


-- 
Edit 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]

Reply via email to