xsl-list
[Top] [All Lists]

RE: identity transform exclude pis and comments

2003-06-23 06:35:58
Hi,

I can do it with an xsl:if inside, but is there anything more 
elegant than 
this:

<xsl:template match="node()|@*">
   <xsl:if test="not(self::processing-instruction() or 
self::comment()">
     <xsl:copy><xsl:apply-templates/></xsl:copy>
   </xsl:if>
</xsl:template>

<xsl:template select="processing-instruction() | comment()" />

Cheers,

Jarno - VNV Nation: Rubicon

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list