ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> phpdoc
phpdoc
[PHP-DOC] #39565 [Opn]: xmlparser and accentuated letters
by derick other posts by this author
Nov 21 2006 12:17AM messages near this date
Re: [PHP-DOC] [PATCH] odbc_next_result - Documenting the undocumented. | [PHP-DOC] #39565 [Opn]: xmlparser and accentuated letters
ID:               39565
 Updated by:       derick@[...].net
 Reported By:      sotiwin at freemail dot hu
 Status:           Open
-Bug Type:         XML related
+Bug Type:         Documentation problem
 Operating System: Windows XP
 PHP Version:      5.2.0
 New Comment:

This is expected behavior, although we should definitely document this
in a bit better way - changing it to a documentation problem.


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

[2006-11-21 02:16:31] sotiwin at freemail dot hu

Description:
------------
I want to parse an xml, with accentuated letters, but the parser cuts
the characters before the first accentuated letter of each
'characterData'.

I use Wamp5 with php 5.1.6.

Reproduce code:
---------------
<meta http-equiv="Content-type" value="text/html; charset=ISO-8859-1"
/> 
<?php
	function characterData($parser, $data)
	{
		  echo $data.'1';
	}
	$data='<?xml version="1.0"
encoding="ISO-8859-1"?> <book>Example��</book>';
	echo 'XML input:<br> '.$data;
	
	$xml_parser = xml_parser_create('ISO-8859-1');
	xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE,1);
	xml_set_character_data_handler($xml_parser,'characterData');
	
	echo '<br> Parsed data:<br>';
	if (!xml_parse($xml_parser, $data)) 
	{
		die(sprintf("XML error: %s at line %d",
            xml_error_string(xml_get_error_code($xml_parser)),
            xml_get_current_line_number($xml_parser)));	
						
	}
	xml_parser_free($xml_parser);
?> 

Expected result:
----------------
characterData could have run only once.

XML input:
Example��
Parsed data:
Example��1


Actual result:
--------------
characterData could have runs twice.
XML input:
Example��
Parsed data:
Example1��1


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


-- 
Edit this bug report at http://bugs.php.net/?id=39565&edit=1
Thread:
derick
Sotiwin At Freemail Dot Hu

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved