removing namespace when copying from another document

I have two xml documents, the one is a service request and the other a query response. (This is done in Mediator with multi part message). I want to copy the result of the query into the service request document, this works fine except that the namespaces are copied as wel and I don’t want them.

Here is my transformation, at the moment the second document is a file.

<xsl:stylesheet xmlns:xsl=“” version=“1.0”>
<xsl:output method=“xml” indent=“yes” encoding=“UTF-8” media-type=“text/xml”/>
<xsl:param name=“BD.path”/>
<xsl:template match="/" >

<xsl:copy-of select=“Service”/>
xsl:exclude-result-prefixes=“ino xql xq”>
<xsl:copy select=“document(‘C:\Development\BD\QueryTst.xml’)/ino:response/xq:result/*”/>



I guess your second xsl:copy must also be a xsl:copy-of since
xsl:copy does not allow for a select attribute.
Anyway, to get rid of the namespaces use xsl:apply-templates
instead of copying to run the nodes taken from the query output
through a namespace-reducing transformation as follows:

<xsl:template match="">
<xsl:element name="{local-name()}">
<xsl:for-each select="@
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>

If your stylesheet includes other transformations besides
those pertaining to xquery output, use modes.


Thanks Juliane, that was exactly what I needed.