The function currently does not escape open markup delimiters when writing contents, hence the literal XML written by the object-scraper comes out unreadable.
Solution is to regex/replace < and & in string content with their escaped forms, to represent them as literals.
A simple object for testing:
{ "key": "tiny bitto JSON < & >" }
comes out
<map xmlns="http://www.w3.org/2005/xpath-functions">
<string key="key">tiny bitto JSON < & ></string>
</map>
Note the > is a red herring - it does not need to be escaped.
The function currently does not escape open markup delimiters when writing contents, hence the literal XML written by the object-scraper comes out unreadable.
Solution is to regex/replace
<
and&
in string content with their escaped forms, to represent them as literals.A simple object for testing:
comes out
Note the
>
is a red herring - it does not need to be escaped.