>> English << | Français | Deutsch | Magyar | 中文 | Polski ZVON > Tutorials > XSLT Tutorial
>> Page 45 << | Prev | Next | Contents | Element Index

Functions true() and false() are useful, when some conditions are tested during programming.

XSLT stylesheet 1

XML Source
<source>

<number>0</number>
<number>1</number>

</source>

Output
<P>true not false</P>

<P>true not false</P>

HTML view

true not false

true not false

XSLT stylesheet
<xsl:stylesheet version = '1.0'
     xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

<xsl:template match="number">
     <P>
          <xsl:if test="true()">
               <xsl:text>true </xsl:text>
          </xsl:if>
          <xsl:if test="not(false())">
               <xsl:text>not false</xsl:text>
          </xsl:if>
     </P>
</xsl:template>


</xsl:stylesheet>