This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: not() function not working


Hi Kartheek,

though you found already a working solution, a small comment of mine 

> <xsl:template match="child1[not(@type='one')]">
> 	<xsl:value-of select="."/>
> </xsl:template>

This template defines what to do for child1 elements which meet
a certain condition (not(@type='one')). You don't specifiy what
to do for the other child1 elements. 
In this case the built-in templates will be used which lead 
eventually to the same output.

You might want to solve this by adding another template:

<xsl:template match="child1" priority="-1" />  <!-- do nothing -->

Or you can use xsl:if and replace your template with the following

<xsl:template match="child1">
   <xsl:if test="not(@type='one')">
      <xsl:value-of select="." />
   </xsl:if>
</xsl:template>

Cheers,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@informatik.hu-berlin.de             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]