#24863 [Fbk->NoF]: Not all entity names recognised and some output glitches
| From: | sniper@php.net | Date: | Wed, 06 Aug 2003 16:05:58 +0000 |
| Subject: | #24863 [Fbk->NoF]: Not all entity names recognised and some output glitches | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-45469@lists.php.net to get a copy of this message | ||
ID: 24863
Updated by: sniper@php.net
Reported By: php at Bothware dot com
-Status: Feedback
+Status: No Feedback
Bug Type: XSLT related
Operating System: Linux & Windows
PHP Version: 4.3.2
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2003-07-30 02:10:09] sniper@php.net
Please provide a full example with all the necessary files.
------------------------------------------------------------------------
[2003-07-29 19:28:04] php at Bothware dot com
Description:
------------
XSLT_process throws errors when it encounters certain valid entity
names, for the data I use, a suitable workarround was to replace them
with enitity numbers within a certain range.
( this maybe a missing feature as opposed to a proper bug )
A definite bug does occur with the output though :
character sequences such as â are output instead of entities such as
’ --- this is really really annoying, and I have to post-process
the output because of it.
WORKARROUNDS :
Solution to input 'bug'
$entities = array(128 => '#8364', 130 => '#8218', 131 =>
'#402', 132 =>
'#8222', 133 => '#8230', 134 => '#8224', 135 =>
'#8225', 136 => '#710',
137 => '#8240', 138 => '#352', 139 => '#8249', 140 =>
'#338', 145 =>
'#8216', 146 => '#8217', 147 => '#8220', 148 =>
'#8221', 149 =>
'#8226', 150 => '#8211', 151 => '#8212', 152 =>
'#732', 153 => '#8482',
154 => '#353', 155 => '#8250', 156 => '#339', 159 =>
'#376'
then do a find & replace
Soltuion to output 'bug'
function correctXSLT( $s ) {
$r = str_replace('â', '’', $s);
$r = str_replace('â', '‘', $r);
$r = str_replace('â', '“', $r);
$r = str_replace('â', '”', $r);
$r = str_replace('â¦', '…', $r);
return $r;
}
Reproduce code:
---------------
$x = xslt_create();
$a['xml']='<?xml version="1.0" encoding="UTF-8"
?'.'><somedata>’
‘ “ ” …</somedata>';
$result = xslt_process($x, 'arg:/_xml', 'xslInstr.xsl', NULL, $a);
/* this is a very minimalised example -- the actual files I'm
processing are about 2mb each !! */
Expected result:
----------------
’
‘
“
”
…
Actual result:
--------------
â
â
â
â
â¦
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24863&edit=1