By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

SAX character expansion

P: n/a
The following piece of code
$string = "<root><node>&#xA9;</node></root>";

$xp = xml_parser_create( 'ISO-8859-1' );

xml_set_element_handler( $xp, 'sh', 'eh' );
xml_set_character_data_handler( $xp, 'cd' );

xml_parser_set_option( $xp, XML_OPTION_CASE_FOLDING, false );
xml_parser_set_option( $xp, XML_OPTION_TARGET_ENCODING, 'ISO-8859-1' );

function sh( $p, $el, $at ) {
print '<'.$el.'>';

function eh( $p, $el ) {
print '</'.$el.'>';

function cd( $p, $data ) {
print $data;

xml_parse( $xp, $string );

Will give this output when executed whith PHP 5.0.3


The replacing of &#xA9; with is something I want to disable. Does anybody
has a solution for this?

Thanks in advance
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

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.