I have some very simple XML that I want to convert into a hash (sample below):
<rec id = 'F600' type = 'J'>
<author>A. S. Bommarius, K. Drauz, W. Hummel, M.-R. Kula, C. Wandrey</
+author>
(snippage)
</rec>
Most of the time XML::Simple converts this just fine.
Unfortunately if one of the author names contains an umlaut (ö or ü or ä) then I get this error from XML::Parser (presumably called by XML::Simple):
"Error: not well-formed at line 2, column 18, byte 49 at c:/Perl/site/lib/XML/Parser.pm line 168"
where the character specified is the umlauted character.
I'm not finding an obvious way to tell XML::Simple that umlauts are OK (i.e. that I'm using ISO Latin-1). I would prefer not to have to do s/ö/ö/ lines before I use XML::Simple although that clearly is a possibility.
FWIW
XML::Simple Version: 1.06;
XML::Parser Version: 2.27;
Dingus
Enter any 47-digit prime number to continue.
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.