Hi all, I'm getting the following XML parsing error:
[Fri Mar 10 09:37:39 2006] insert_xml.pl: not well-formed (invalid token) at
line 13628, column 24, byte 413248:
[Fri Mar 10 09:37:39 2006] insert_xml.pl: <la>LA14</la>
[Fri Mar 10 09:37:39 2006] insert_xml.pl: <seed>5741726</seed>
[Fri Mar 10 09:37:39 2006] insert_xml.pl: <school_name>St. Patricks R.C.
P.S.</school_name>
[Fri Mar 10 09:37:39 2006] insert_xml.pl: =======================^
[Fri Mar 10 09:37:39 2006] insert_xml.pl: <council>Falkirk</council>
[Fri Mar 10 09:37:39 2006] insert_xml.pl: <ce>CE-511 (Edge)</ce>
[Fri Mar 10 09:37:39 2006] insert_xml.pl: at
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/XML/Parser.pm line
185
I've checked my XML file and it contains:
<school_name>St. Patrick<92>s R.C. P.S.</school_name>
This is because St. Patrick's contains an apostrophe. I have a couple of
regexes to handle ampersands and apostrophes, however the apostrophe regex
doesn't appear to be working correctly:
ampersand regex works:
$data->[$i] =~ s/&/&/g;
apostrophe regex doesn't work:
$data->[$i] =~ s/'/'/g;
Any ideas on this one?
G :)
P.S. Thank you to all who replied to my previous post, I got that array
dereferenced properly.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>