parsing XML file

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

i have some problem when i try to print character data emitted by the xml

$parser = xml_parser_create('');
xml_set_character_data_handler($parser, "characterData");

function characterData($parser, $data)
  echo nl2br($data);
this work fine..

but if i try this..
function characterData($parser, $data)
  echo nl2br(trim($data));
all line feed are erased and no <br /> is added to the output..

i've tried to change the character encodings with no success..
bye the way i think that the problem is the encoding..

what i can do?

Site Timeline