On Thu, 2021-07-22 at 09:32 -0400, Jonathan Robie wrote:
I am playing with datasets in which namespaces are unhelpful because they make output harder to read. For production use, though, I want the namespaces to be there.
Ideally, I would like to tell BaseX to drop namespaces while serializing. Sometimes. Ideally, I would like to be able to set this as an option in a .bxs file. Is that possible?
You could run transform() with some simple XSLT to do this easily. Something like this maybe: <xsl:stylesheet version="3" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclode-result-prefixes="#all"
<xsl:mode on-no-match="shallow-copy" /> <xsl:template match="*"> <xsl:element name="local-name()"> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:element> </xsl:template>
And that can appear literally in your XQuery and passed as the stylesheet node to transform.
Thanks!
Jonathan
-- Liam Quin, https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org