How can I exclude result prefixes from an XQuery similiar to the XSLT exclude-result-prefixes attribute in XSL.
Currently my XQuery generates namespace prefixes for namespaces that are not part of the result set, but were part of the original payload.
XQuery doesn’t really have a built-in feature like the exclude-result-prefixes in XSLT. The serialization extension doesn’t seem to help there either. So you will have to do it yourself by processing the end result just before you return it. Shouldn’t be difficult though.
The xqueryfunctions website has functions that could help, like
functx:change-element-names-deep( http://www.xqueryfunctions.com/xq/functx_change-element-names-deep.html ), but that doesn’t really fit the bill here. So, here a more specific solution of my own:HTH!