cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schlichtherle" <christ...@schlichtherle.de>
Subject RE: How to suppress xmlns:jx attribute in output of JXTemplate generator?
Date Sat, 02 Jun 2007 13:21:32 GMT
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

Mime
View raw message