cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <bdelacre...@apache.org>
Subject Re: Removing white space, comments, etc
Date Tue, 28 Sep 2004 07:30:40 GMT
Le 28 sept. 04, à 09:12, Conal Tuohy a écrit :
> ...Add an identity template to copy everything else:
>
> <xsl:template match="@*|*">
> 	<xsl:apply-templates select="@*"/>
> 	<xsl:apply-templates/>
> </xsl:template>...

While we're at it, it is often useful to strip extra namespace nodes:

     <!-- Copy everything but remove namespace nodes that might have 
been left over -->
     <xsl:template match="*">
         <xsl:element name="{name()}">
             <xsl:apply-templates select="@*|node()"/>
         </xsl:element>
     </xsl:template>

     <xsl:template match="@*|text()|comment()|processing-instruction()">
         <xsl:copy>
             <xsl:apply-templates select="@*|node()"/>
         </xsl:copy>
     </xsl:template>

-Bertrand


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message