I'm having troubles getting the euro sign through an XML parser.
With the following test code:
<?php
$string = "<root><tes t>€</test></root>";
$parser = xml_parser_crea te();
xml_set_charact er_data_handler ( $parser, 'cdata' );
xml_set_element _handler( $parser, 'starthandler', 'endhandler' );
if( !xml_parse( $parser, $string ) ) {
print xml_error_strin g( xml_get_error_c ode( $parser ));
}
function cdata( $p, $data ) {
print $data."\n";
}
function starthandler( $p, $tag, $att ) {
// print $tag."\n";
}
function endhandler( $p, $tag ) {
// print $tag."\n";
}
?>
I get the following result for $string
$string = "<root><tes t>€</test></root>";
?
$string = "<root><test>&# x20AC;</test></root>";
?
$string = "<root><test>&e uro;</test></root>";
Undeclared entity error
Any solutions to this problem?
Rutger Claes
--
Rutger Claes rg*@rgc.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
Do not reply to the from address. It's read by /dev/null and sa-learn only