#31994 [Opn->Fbk]: output conversion failed due to conv error
| From: | sniper@php.net | Date: | Fri, 25 Feb 2005 13:38:29 +0000 |
| Subject: | #31994 [Opn->Fbk]: output conversion failed due to conv error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74572@lists.php.net to get a copy of this message | ||
ID: 31994
Updated by: sniper@php.net
Reported By: misnet at hotmail dot com
-Status: Open
+Status: Feedback
Bug Type: XSLT related
Operating System: windows 2003 server
PHP Version: 5.0.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-02-16 10:06:47] misnet at hotmail dot com
Description:
------------
a.xml
=============================================
<?xml version="1.0" encoding="GB2312"?>
<Article>
<Title>test</Title>
<Author>ehero</Author>
<ComeFrom>Öйú</ComeFrom>
<HtmlUrl>a.html</HtmlUrl>
<CatalogId>2</CatalogId>
<Contents><![CDATA[²âÊÔ]]></Contents>
<AddTime>2005Äê</AddTime>
<UpdateTime></UpdateTime>
<Hits>3</Hits>
<ServerFile></ServerFile>
<LocalFile></LocalFile>
<EncodeLocalFile></EncodeLocalFile>
<PageIndex>0</PageIndex>
<TotalPageNum>1</TotalPageNum>
<PageUrl>a.shtml</PageUrl>
</Article>
=============================================
cms.xsl:
=============================================
<?xml version="1.0" encoding="GB2312" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:php="http://php.net/xsl"
xsl:extension-element-prefixes="php">
<xsl:output method="html" encoding="GB2312" indent="yes"/>
<xsl:template match="/">
<html>
.....
=============================================
s.php:
=============================================
<?php
$xml = new DOMDocument("1.0","GB2312");
$xml->load("a.xml");
$xsl = new DOMDocument("1.0","GB2312");
$xsl->load("cms.xsl");
$proc = new XSLTProcessor;
$proc->importStyleSheet($xsl);
$proc->registerPHPFunctions();
$d = $proc->transformToUri($xml,"s.xml");
?>
=============================================
When I run s.php, it will be wrong!.Below is the exception messages.
Warning: output conversion failed due to conv error in
D:\myphp\yibo\t.php on line 9
Warning: Bytes: 0xB5 0xEB 0x2D 0x3C in D:\myphp\yibo\t.php on line 9
I have tested $xml->load("a.xml") and $xsl->load("cms.xsl"),they are
right. I can get $xml->saveXML() and $xsl->saveXML().
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31994&edit=1