Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks, I'm parsing some XML files with XML::Twig, and getting the error below on some files, e.g.:
not well-formed (invalid token) at line 26, column 89, byte 4127 at C:/Perl64/lib/XML/Parser.pm line 187It turns out it's failing on special characters such as the registered or copyright symbols.
I can use regex's to take those out (after stuffing the XML into a variable and using parse() instead of parsefile()), but is there a way I can tell Parser.pm to just ignore or accept them? I'm afraid I'd have to catch them all and might miss a few.
$content =~ s/®//g;thanks,
Scott
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML Parser error
by moritz (Cardinal) on Aug 26, 2011 at 12:05 UTC | |
by Anonymous Monk on Aug 26, 2011 at 12:16 UTC | |
by moritz (Cardinal) on Aug 26, 2011 at 12:19 UTC | |
by Anonymous Monk on Aug 26, 2011 at 14:30 UTC | |
by moritz (Cardinal) on Aug 26, 2011 at 15:08 UTC | |
|