xslt encoding problem
| From: | Mike Eynon | Date: | Sun, 10 Mar 2002 21:22:24 +0000 |
| Subject: | xslt encoding problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-87932@lists.php.net to get a copy of this message | ||
Howdy all.
I am trying to use the new XSLT translation stuff in 4.1.1 with Win2k and
IIS running ISAPI.
When I try to run even the simplest example, I get the following error:
>>>>>>>>>>>>>
unknown encoding ''
62
<<<<<<<<<<<<<
I have tried specifying the encoding in both the XML and XSL files, and even
tried both "UTF-8" and "ISO-8859-1".
Has anyone seen this? I am pretty much stuck and in need of at least a
suggestion.
Below are the following xml, xsl, and php source files I am using.
t1.xml
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<Company>
<Employee>
<Name>
Mike
</Name>
<Email>
stingray@onth.com
</Email>
</Employee>
</Company>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
t1.xsl
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8
omit-xml-declaration="yes""/>
<xsl:template match="/">
<html>
<head>
<title>Mike's php xml test</title>
</head>
<body>
<xsl:apply-templates select="//Employee"/>
</body>
</html>
</xsl:template>
<xsl:template match="Employee">
<xsl:apply-templates select="Email"/>
</xsl:template>
<xsl:template match="Email">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
t1.php
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<?php
$xsl_parser = xslt_create();
$xmlf="c:\\t1.xml";
$xslf="c:\\t1.xsl";
$outf="c:\\out.html";
if(is_file($xmlf)){
print("XML Exists<BR>\n");
}
if(is_file($xslf)){
print("XSL Exists<BR>\n");
}
$result = xslt_process($xsl_parser,$xmlf,$xslf,$outf);
if ($result)
{
echo "$result";
}
else
{
$err1 = xslt_error($xsl_parser);
$err2 = xslt_errno($xsl_parser);
echo "<BR><BR><B>Bummer.</B>
<br><br><br>";
echo "$err1 <br>";
echo "$err2 <br>";
}
xslt_free($xsl_parser);
?>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I robbed some of my test code from the example Christian posted
a couple days ago. Thanks Christian.
// Mike Eynon
// www.MikeEynon.com
// 1366 Bulb Ave
// Santa Cruz, CA 95062
// stingray@MikeEynon.com
// 831.588.2388 (cell)