xmerl and ISO-8859-1, ISO-Latin-1

Anders Nygren anders.nygren@REDACTED
Fri Feb 18 00:17:43 CET 2005


I have been trying to use xmerl to read some xml files that start with

<?xml version="1.0" encoding="ISO-8859-1" ?>

Erlang (BEAM) emulator version 5.4 [source] [hipe]

3> xmerl_scan:file("xml-callejero.txt").

** exited: {bad_character_code,"<callejero-sites>\r\n<numOfResults
value=\"4\" /> \r\n<site-list>\r\n<site long=\"-99.15984344\"
lat=\"19.37835503\" id=\"153737\">\r\n<name>Ford</name>
\r\n<address>Av. Universidad No. 1005 Esq. Jose Maria Rico</address>
\r\n<neighborhood>Del Valle</neighborhood>
\r\n<telefono>52000900</telefono> \r\n<cp>03100</cp>
\r\n<distance>3726</distance> \r\n</site>\r\n<site
long=\"-99.14178467\" lat=\"19.36811829\"
id=\"175048\">\r\n<name>Mayoreo paraFord, S.A. de C.V.</name>
\r\n<address>Municipio Libre No. 143 Int.
1</address>\r\n<neighborhood>Portales</neighborhood>
\r\n<telefono>56744463</telefono> \r\n<cp>03300</cp>
\r\n<distance>4861</distance> \r\n</site>\r\n<site
long=\"-99.17591095\" lat=\"19.39871407\"
id=\"202063\">\r\n<name>Walletin Crawford Dr.</name>
\r\n<address>Viaducto Miguel Aleman No. 228 Int. 201</address>
\r\n<neighborhood>Escandon</neighborhood>
\r\n<telefono>55368525</telefono> \r\n<cp>11800</cp>
\r\n<distance>4871</distance> \r\n</site>\r\n<site
long=\"-99.17591095\" lat=\"19.39871407\"
id=\"202064\">\r\n<name>Walletin Crawford Dr.</name>
\r\n<address>Viaducto Miguel Aleman No. 228 Int. 201</address>
\r\n<neighborhood>Escandon</neighborhood>
\r\n<telefono>55368789</telefono> \r\n<cp>11800</cp>
\r\n<distance>4871</distance>
\r\n</site>\r\n</site-list>\r\n<search-info>\r\n<message />
\r\n<code>0</code> \r\n<alter-distance>5</alter-distance>
\r\n</search-info>\r\n</callejero-sites>\r\n",
                               'iso-8859-8'} **

I dont know much about neither xml nor the finer details of character codes,
but I have two questions
1, Is ISO-Latin-1 not supported?
2, Why does xmerl complains about 'iso-8859-8' when it is "ISO-8859-1" in
    the header?

Can anyone shed some light on this, is it a bug or is it a feature I
dont understand?

/Anders Nygren



More information about the erlang-questions mailing list