|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-30 02:10 UTC] sniper@php.net
[2003-08-06 11:05 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 09:00:01 2025 UTC |
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: -------------- ’ ‘ “ ” …