Am 24.03.2019 um 06:47 schrieb Liam R. E. Quin:
Note that if you don’t have the XML output method, strings are output without escaping, so you can’t see that it has worked.
Interesting, indeed. I wonder whether it wouldn't make sense, to have BaseX provide escape()/unescape() shortcut functions, maybe in the conversion module.
For now, I found a way to circumvent the global setting by adding an addition fn:serialize#1 function call:
declare function local:escapexml($input as item()*) as xs:string? { serialize(<wrapper>{fn:serialize($input)}</wrapper>/text(),map{"method":"xml"}) };
Thanks for helping out!