Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: XML Parser not well-formed

by bart (Canon)
on Nov 04, 2004 at 14:13 UTC ( [id://405172]=note: print w/replies, xml ) Need Help??


in reply to XML Parser not well-formed

That character looks like one of Microsoft's additions to ISO-Latin-1, somewhere in the range 128-159.

Don't do that. Your XML is invalid because of it. Please don't try to patch the XML parser to accept it, you're making life harder for everybody — XML parsers merciless rejecting invalid XML is a feature, forcing people to produce proper XML. Guessswork isn't doing anybody any good.

Instead, replace it with the proper Unicode character in the proper character encoding (UTF-8?) or as a numerical entity, in the XML file. It ought to work then.

You can find the equivalent character code (in hex) in that table I linked to, and it would seem to me that this is the one:

0x92	0x2019	#RIGHT SINGLE QUOTATION MARK

So "’" ought to do it. Test: "’"

p.s. Actually, you should get the source of the data to fix it, they did not do a proper job.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://405172]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-18 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found