cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject Re: Cleaning up unused namespace declaration
Date Mon, 09 Feb 2004 08:16:18 GMT
Stefano Mazzocchi wrote:
> Yeah, well, that doesn't help me because I have the namespace 
> declarations already there in the document I want to process and it 
> appears that xsl:copy copies over the namespace declarations everytime 
> and it's not influenced by exclude-result-prefixes.

   <!--
      - Namespace removing templates
      - from http://outerthought.net/wiki/Wiki.jsp?page=RemoveNamespaces
   -->
   <xsl:template match="*" priority="-1" mode="copy">
     <xsl:element name="{local-name()}">
       <xsl:copy-of select="@*"/>
       <xsl:apply-templates mode="copy"/>
     </xsl:element>
   </xsl:template>

   <xsl:template match="text()" mode="copy">
     <xsl:value-of select="."/>
   </xsl:template>

HTH,

		Ugo



Mime
View raw message