In an XML file where the first line is
<?xml version="1.0" encoding="UTF-8"?>
I get the following error message when trying to open it with Internet Explorer
The XML page cannot be displayed
Cannot view XML input using XSL style sheet.
Please correct the error and then click the Refresh button, or try again later.
An invalid character was found in text content. Error processing resource
'file name
...
characters in line then (1=0
The file also fails to parse, that is the eval below fails
$parser = new XML::DOM::Parser;
eval {$doc = $parser->parsefile($filename)}
When the first line is
<?xml version="1.0" encoding="ISO-8859-1" ?>
everything works well
The character after the (1=0 is a ° (a degree sign)
I guess that the reason is something like that when you want a degree sign and
UTF-8 coding, the degree sign has to be written in a specific way
or perhaps the parsing has to be done if a different way.
Can a wiser Monk let me know if either is true and what should be done to overcome the problem?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.