37 $charData =
'<b>c</b>';
38 $xml =
'<a>' . htmlspecialchars( $charData ) .
'</a>';
40 $parser = xml_parser_create();
41 xml_set_character_data_handler( $parser, [ $this,
'chardata' ] );
42 $parsedOk = xml_parse( $parser, $xml,
true );
43 $this->ok = $parsedOk && ( $this->parsedData == $charData );