Hi,

based on your script, this is what I derived:

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Strips unused XML namespace declarations from the result tree. -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
    <xsl:template match="*">
        <xsl:element name="{name()}">
            <xsl:apply-templates select="@*"/>
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="@*">
        <xsl:copy/>
    </xsl:template>
</xsl:stylesheet>

The difference to the script provided by you is that this one only removes
namespaces if they are not used by an element. So the resulting XML is
remains valid.

Thank you very much again for setting me on the right track.

Kind regards,
Christian

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to