[xsl] Trying to remove default namespace declaration in output

Subject: [xsl] Trying to remove default namespace declaration in output
From: "dvint@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 5 Mar 2019 15:46:16 -0000
I'm using XSLT to process DITA topics. This is a conversion/cleanup
effort to try and normalize our content before loading into a new CMS.
So basically doing an identity transformation with some random
modifications.

In the DTD is the definitionB xmlns:ditaarch
=
"http://dita.oasis-open.org/architecture/2005/";

This is the primary template that is doing the transformation

	B  B B 
<xsl:template match
=
"node()"
 priority
=
"-10"
>

B  B  B  B 

<xsl:copy>
B  B  B  B  B  B 

<xsl:call-template name
=
"processAtrbiutes"
/>

B  B  B  B  B  B 

<xsl:apply-templates select
=
"node()"
/>

B  B  B  B 

</xsl:copy>
B  B 

</xsl:template>

	And this is the template that I have handling the attributes

	<xsl:template
 name
=
"processAtrbiutes"
>

B  B 
<xsl:for-each
 select
=
"./@*"
>

B  B  B  B 
<xsl:choose>

B  B  B  B  B  B 
<xsl:when
 test
=
"name(.) = 'class'"
>

B  B  B  B  B  B  B  B 
<!-- Remove -->

B  B  B  B  B  B 
</xsl:when>

B  B  B  B  B  B 
<xsl:when
 test
=
"name(.) = 'domains'"
>

B  B  B  B  B  B  B  B 
<!-- Remove -->

B  B  B  B  B  B 
</xsl:when>

B  B  B  B  B  B 
<xsl:when
 test
=
"local-name(.) = 'DITAArchVersion'"
>

B  B  B  B  B  B  B  B 
<!-- Remove -->

B  B  B  B  B  B 
</xsl:when>

B  B  B  B  B  B 
<xsl:when
 test
=
"local-name(.) = 'ditaarch'"
>

B  B  B  B  B  B  B  B 
<!-- Remove -->

B  B  B  B  B  B 
</xsl:when>

B  B  B  B  B  B 
<xsl:when
 test
=
"local-name(.) = 'ux-source-priority'"
>

B  B  B  B  B  B  B  B 
<!-- Remove -->

B  B  B  B  B  B 
</xsl:when>

B  B  B  B  B  B 
<xsl:otherwise>

B  B  B  B  B  B  B  B 
<xsl:attribute
 name
=
"{local-name(.)}"
 select
=
"."
/>

B  B  B  B  B  B 
</xsl:otherwise>

B  B  B  B 
</xsl:choose>

B  B 
</xsl:for-each>

</xsl:template>

	Basically I want to copy the attributes in the XML file that have
been applied and remove anything that has a default in the DTD.

	I have the ditaarch test here that is doing no good, but the other
tests do what they are supposed to. For the namespace I tried
declaring this namespace on the <xsl:stylesheet> element and then
exclude it but that didn't work either.

	Any suggestions?

	..dan

Current Thread