http://qs1969.pair.com?node_id=471309


in reply to Why XML not well formed?

As mentionned before, there is probably nothing wrong with the script, just something wrong with the data. Try looking at line 221, column 97, or using the ErrorContext => 1 argument when you create the XML::Parser object, which will display the faulty line.

A not well-formed (invalid token) error is often found when an ampersand (&) or an opening bracket (<) are not escaped in the XML.

Replies are listed 'Best First'.
Re^2: Why XML not well formed?
by nan (Novice) on Jun 30, 2005 at 15:51 UTC

    Mirod,

    Yes, you are absolutely right. I think '&' is the key...but I don't know how to overcome it as I'm new to perl? Please, if you have any ideas. I've tried put a '\' before '&' but it doesn't work.

    Many thanks, Nan

Re^2: Why XML not well formed?
by Anonymous Monk on Feb 20, 2010 at 17:36 UTC
    You fixed my issue as well. I had "&" characters in my data. Thank you very much.