<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.spelle
        {mso-style-name:spelle;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">When parsing the following simple XML string,</span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span class="spelle"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">xmerl</span></span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">doesn’t
 handle the Unicode attribute value correctly:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span class="spelle"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">xmerl_scan:string</span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">("<?xml version=\"1.0\"?><hello
 attribute=\"&#xb0;\"></hello>").<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">{{<span class="spelle">xmlElement,hello,hello</span>,[],<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">{<span class="spelle">xmlNamespace</span>,[],[]},<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[],1,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[{<span class="spelle">xmlAttribute,attribute</span>,[],[],[],<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">                           </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[{hello,1}],</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">                           </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">1,[],"°<span class="spelle">Â",false</span>}],</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[],[],</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">"/home/mmueller/work/<span class="spelle">entelios</span>/NOC-<span class="spelle">Config</span>/<span class="spelle">Erlang</span>/<span class="spelle">parsexml</span>",<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">undeclared},<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[]}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The resulting attribute value should be a single character. [1] mentions that</span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span class="spelle"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">xmerl</span></span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">can
 parse Unicode, provided that attribute names can be mapped to ASCII.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">The result is the same when the xml encoding is specified explicitly:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span class="spelle"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">xmerl_scan:string</span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">("<?xml version=\"1.0\" encoding=\"utf-8\"
 ?><hello attribute=\"&#xb0;\"></hello>").<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">{{<span class="spelle">xmlElement,hello,hello</span>,[],<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">{<span class="spelle">xmlNamespace</span>,[],[]},<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[],1,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[{<span class="spelle">xmlAttribute,attribute</span>,[],[],[],<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">                  </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">         [{hello,1}],<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">                           </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">1,[],"°<span class="spelle">Â",false</span>}],<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[],[],<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">"/home/mmueller/work/<span class="spelle">entelios</span>/NOC-<span class="spelle">Config</span>/<span class="spelle">Erlang</span>/<span class="spelle">parsexml</span>",<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">            </span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">undeclared},<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[]}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Apparently, "°Â" is the list of UTF8 bytes in _<i>reversed order</i>_.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">With kind regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Magnus Müller<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif"">[1]</span><span class="apple-converted-space"><span lang="EN-US" style="font-family:"Calibri","sans-serif""> </span></span><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif""><a href="http://www.erlang.org/doc/apps/xmerl/xmerl_ug.html#id61231"><span style="color:#954F72">http://www.erlang.org/doc/apps/xmerl/xmerl_ug.html#id61231</span></a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";mso-fareast-language:EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>