php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24863 Not all entity names recognised and some output glitches
Submitted: 2003-07-29 19:28 UTC Modified: 2003-08-06 11:05 UTC
Votes:4
Avg. Score:3.8 ± 0.4
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: php at Bothware dot com Assigned:
Status: No Feedback Package: XSLT related
PHP Version: 4.3.2 OS: Linux & Windows
Private report: No CVE-ID: None
 [2003-07-29 19:28 UTC] 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 &#8217 --- 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('‘', '&#8216', $r);
		$r = str_replace('“', '“', $r);
		$r = str_replace('”', '”', $r);
		$r = str_replace('…', '&#8230', $r);
		return $r;
	}

Reproduce code:
---------------
$x = xslt_create();
$a['xml']='<?xml version="1.0" encoding="UTF-8" ?'.'><somedata>&#8217 &#8216 &#8220 &#8221 &#8230</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:
----------------
&#8217
&#8216
&#8220
&#8221
&#8230

Actual result:
--------------
’
‘
“
”
…

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-30 02:10 UTC] sniper@php.net
Please provide a full example with all the necessary files.

 [2003-08-06 11:05 UTC] sniper@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC