ID:               32078
 User updated by:  roger4a45 at yahoo dot es
 Reported By:      roger4a45 at yahoo dot es
 Status:           Open
 Bug Type:         DOM XML related
 Operating System: Windows XP
 PHP Version:      5.0.2
 New Comment:

Note: I see some chars from my explanation are bad. Characters have
problems are accents like à (using html encoding) So, I want to
output Andràs Poluk.

In ref2: Output seeing IE Explorer source is: Andr鳠Poluk (using
same html encoding).


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

[2005-02-23 11:01:19] roger4a45 at yahoo dot es

Description:
------------
ref 1:
I try to build a XML using DOM extensions and then I want to output
this one by using XSLT extensions. My XML is created dinamicaly using
createElements / appendChilds as i will show below. If I use specials
chars like �� �� i can see a warning when i make and saveXML from
DOMDocument.

echo $xmlDOMDoc->saveXML()

Warning: output conversion failed due to conv error in d:\archivos de
programa\apache group\Apache\htdocs\newnovoprint\test\v2.php on line
122

Warning: Bytes: 0xE9 0x73 0x20 0x50 in d:\archivos de programa\apache
group\Apache\htdocs\newnovoprint\test\v2.php on line 122
Andres Poluk Andr

ref2:
If I try to use XSLT extensions when i make a TransformToXML() output
is wrong. Andr��s is output as a Andr��.

ref3:
I check documentation and i didn't find any information about that
problem. 

If I load same XML from a file and i use XSLT extensions that result is
OK.

In code example i put third easy examples i build to explain this
possible bug. 

Reproduce code:
---------------
XML I want to make (tested) known as v1.xml in third source.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<TEST>
<NAME>Andr��s Polim</NAME>
</TEST>

XSL I use v1.xsl (tested)

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns="http://www.w3.org/TR/REC-html40";>
<xsl:template match="TEST">
<xsl:value-of select="NAME"/><BR/>
</xsl:template>
</xsl:stylesheet>

First Code ref: 1

<?php 
$xml = new DOMDocument('1.0', 'iso-8859-1');
$root = $xml->CreateElement("TEST");
$child = $xml->CreateElement("NAME","Andr��s Poluk");
$root->appendChild($child);
$xml->appendChild($root);
echo $xml->saveXML(); // <----- Error
?> 

Second Code ref: 2
<?php 
$xml = new DOMDocument('1.0', 'iso-8859-1');
$xsl = new DOMDocument;
$xsl->load('v1.xsl');
$proc = new XSLTProcessor;
$root = $xml->CreateElement("TEST");
$child = $xml->CreateElement("NAME","Andr��s Poluk");
$root->appendChild($child);
$proc->importStyleSheet($xsl);
echo $proc->transformToXML($xml);       
?> 

Third code ref: 3 (This one works ok)
<?php 
$xml = new DOMDocument;
$xsl = new DOMDocument;
$proc = new XSLTProcessor;
$xml->load('v1.xml');
$xsl->load('V1.xsl');
$proc->importStyleSheet($xsl);
echo $proc->transformToXML($xml);       
?>


Expected result:
----------------
ref1,ref2,ref3:
Andr��s Poluk (A simple text) 

or 

<?xml version="1.0" encoding="ISO-8859-1"?>
Andr��s Poluk


Actual result:
--------------
ref1:


Warning: Bytes: 0xE9 0x73 0x20 0x50 in d:\archivos de programa\apache
group\Apache\htdocs\newnovoprint\test\v2.php on line 122
Andres Poluk Andr

ref2: 
Andr��. Poluk

ref3:

Andr��s Poluk



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32078&edit=1

Reply via email to