Re: [xsl] zap some node

Subject: Re: [xsl] zap some node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 27 Sep 2006 15:11:37 +0100
 > but  i need  with the same xslt to zap some node such as this :
TipoEsenzione how to  to this :

Just add a template that does whatever you want to do for that element
  (which is nothing in this case)

  <xsl:template match="cup:TipoEsenzione"/>

Also you can do the same thing for attributes, 

No need to do this:

[name()!='idCUP']"/>
            <xsl:if test="@idCUP">

Just apply templates to teh attributes and have a template for attribute
that you need to treat differently:



<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:cup="http://regione.campania.it/schemas/cup";>
    <xsl:strip-space elements="*"/>
    <xsl:output indent="yes"/>
   
    <xsl:template match="@*|*">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>

  <xsl:template match="cup:TipoEsenzione"/>
 
  <xsl:template match="@idCUP">
     <xsl:attribute name="idCup">
       <xsl:value-of select="@idCUP"/>
     </xsl:attribute>
  </xsl:template>

</xsl:stylesheet>

Current Thread