Reputation: 5022
I have an XML snippet, say:
<root>
<node>This & that</node>
</root>
This needs to be sent over SOAP as a string, our framework escapes it as:
<root><node>This &amp; that</node></root>
An end-user tells us this doesn't parse, and our unit test (correctly) unescapes it. The resultant XML snippet should be conformant - <node>This &amp; that</node>
from transmission should result in <node>This & that</node>
to send to a rendering layer when unescaped, right?
Upvotes: 1
Views: 3225
Reputation: 43733
Your analysis appears correct. From the available evidence, I would conclude that your end-user's software is not correctly handling the data, such as by extracting XML text (un-unescaped, if you see what I mean) from the SOAP message (rather than the text content of the document) and attempting to parse that, or using something other than an XML parser at some stage.
Perhaps you could make sure your and their systems correctly process e.g. plain text such as In order to write a literal "&" in XML, HTML, or SGML text one writes "&" instead
.
(I am mildly concerned by your description of a unit test as "doubly-unescaping" the text, as this suggests dangerous ways of thinking about the problem. If you "unescape" the string <root><node>This &amp; that</node></root>
twice, the result is either an error or the string <root><node>This & that</node></root>
which is neither well-formed XML nor anything else you should likely want.)
Upvotes: 2