[erlang-questions] XMERL Atr String Escaping

Anthony Jackson anthony.jackson@REDACTED
Fri Jan 23 14:52:31 CET 2015


Hey

Yes I am integrating with with an MNO and it would seem it breaks their XML decoder.
I would be curious to know what they use, as its also written in Erlang.

Looks like there isn’t a way to tweak the xmerl:export_simple/2 function.
I have to obfuscate the gt character before the export, and post process the XML string.. regex to the rescue… :|

-- 
Anthony

On 23 Jan 2015, at 15:08, Vlad Dumitrescu <vladdu55@REDACTED> wrote:

> Hi!
> 
> I guess that it's not escaped because it's not required to be. Only & and < must be, according to the spec (http://www.w3.org/TR/xml11/#syntax). > must be escaped in text when part of the string "]]>".
> 
> Do you have a parser that chokes on that?
> 
> regards,
> Vlad
> 
> 
> On Fri, Jan 23, 2015 at 12:19 PM, Anthony Jackson <anthony.jackson@REDACTED> wrote:
> Hi
> 
> It would seem that XMERL doesn’t escape greater than characters in Attribute strings.
> Is this a bug, or is this intentional?
> 
> Function to look at is ./xmerl-1.3.6/src/xmerl_lib.erl -> export_attribute/2
> 
> 12> f(Packet), Packet = [{ussd,[ {'STRING',"this has > escape"}],["this has > escape", {cookie,[],[]}]}].
> [{ussd,[{'STRING',"this has > escape"}],
>        ["this has > escape",{cookie,[],[]}]}]
> 13> lists:flatten(xmerl:export_simple(Packet, xmerl_xml)).
> "<?xml version=\"1.0\"?><ussd STRING=\"this has > escape\">this has > escape<cookie/></ussd>”
> 
> --
> Anthony
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150123/e03befcc/attachment.htm>


More information about the erlang-questions mailing list