Parser.pm -- not well-formed error

R

Rishi Dhupar

Hi,

General idea of what I am doing: Running a file scan on my hard drive
that is storing the info into an XML file. Then another perl script I
have wrote is parsing this data and making use of it.

Keep getting this error:
not well-formed (invalid token) at line 1742, column 29, byte 67305 at
C:/Perl/s
ite/lib/XML/Parser.pm line 187

The line in the XML file is:
<FileName>3½ Floppy (A).lnk</FileName>

The issue is obviosuly the 1/2 symbol. Is there anyway way to get
around this error? I cannot delete the 1/2 symbol or anything, I need
it exactly the way it is.

Any way to have the parser not validate the XML data or something and
just take it as a literal string?
 
R

Rishi Dhupar

Just figured it out.

I don't know the XML specs too well so I kind of made up the format the
file scan outputted.

Added this line to the top of the document:
<?xml version="1.0" encoding="ISO-8859-1"?>

And seems to all work.

Thanks
 
R

Rishi Dhupar

Is there any encoding that allows & symbols in XML? Without having to
replace to &amp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top