xmerl and $'

Mark Fine mark.fine@REDACTED
Sun May 23 20:58:04 CEST 2010


The character $' is being returned in an XML document, and when I use
xmerl to process the XML document, I get multiple values instead of a
single value:

problem() ->
    Xml = "<?xml version=\"1.0\"
encoding=\"UTF-8\"?>\n<Key>There's a problem</Key>",
    {Doc, _} = xmerl_scan:string(Xml),
    [Value || #xmlText{value = Value} <-
xmerl_xpath:string("//Key/text()", Doc)].

Which returns ["There","'s a problem"] instead of ["There's a problem"].

I note if I pre-process the XML by s/&apos/'/, I will get the expected
["There's a problem"] -- is that the right workaround? Thanks!

Mark


More information about the erlang-questions mailing list