[xsl] how to remove xmls=""

Subject: [xsl] how to remove xmls=""
From: "Joga Singh Rawat jrawat@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 4 Sep 2019 06:03:20 -0000
Dear Expert,
I am getting <front xmlns=""> and <body xmlns=""> as output from below
combination of input xml and xslt. Please let us know how to remove
xmlns=bb.

INPUT
<article xmlns:mml="http://www.w3.org/1998/Math/MathML";
xmlns:xlink="http://www.w3.org/1999/xlink";
xmlns:oasis="http://www.niso.org/standards/z39-96/ns/oasis-exchange/table";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:ali="http://www.niso.org/schemas/ali/1.0/";
article-type="research-article" dtd-version="1.1" xml:lang="en">
<front>
...
</front>
<body>
...</body>
</article>

XSLT
<xsl:template match="article">
    <article
xmlns="http://specifications.silverchair.com/xsd/1/18/SCJATS-journalpublishin
g.xsd">
        <xsl:if test="@article-type">
            <xsl:attribute name="article-type" select="@article-type"/>
        </xsl:if>
        <xsl:if test="@xml:lang">
            <xsl:attribute name="xml:lang" select="@xml:lang"/>
        </xsl:if>
        <xsl:attribute
name="xsi:schemaLocation">http://specifications.silverchair.com/xsd/1/19/SCJA
TS-journalpublishing.xsd
http://specifications.silverchair.com/xsd/1/19/SCJATS-journalpublishing.xsd</
xsl:attribute>
        <xsl:apply-templates/>
    </article>
</xsl:template>

<xsl:template match="node() | @*">
    <xsl:copy copy-namespaces="no" inherit-namespaces="no">
        <xsl:apply-templates select="node() | @*[not(name()='xmlns')]"/>
    </xsl:copy>
</xsl:template>

OUTPUT
<article
xmlns="http://specifications.silverchair.com/xsd/1/18/SCJATS-journalpublishin
g.xsd"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
         xmlns:mml="http://www.w3.org/1998/Math/MathML";
         article-type="research-article"
         xml:lang="en"
         xsi:schemaLocation="http://specifications.silverchair.com/xsd/1/19/S
CJATS-journalpublishing.xsd
http://specifications.silverchair.com/xsd/1/19/SCJATS-journalpublishing.xsd";>
   <front xmlns="">
    ...
   </front>
   <body xmlns="">
   ...
</body>
</article>

thanks in advance
...JSR

Current Thread