Answer 11: Boolean Operators

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:template match="/">
    <html>
        <head>
           <title>Room Temperature Boiling Points</title>
        </head>
        <body>
        <h1>Room Temperature Boiling Points</h1>
        <ul>
        
        <!--  (9/5 * Celsius) + 32 -->
        
          <xsl:apply-templates select=
            "descendant::ATOM[ (9 div 5 * (BOILING_POINT + 273.15)) + 32 > 0 and (9 div 5 * (BOILING_POINT + 273.15)) + 32 &lt; 100]"
           />
         </ul>
         </body>
    </html>
  </xsl:template>
 
  <xsl:template match="ATOM">
    <li><xsl:value-of select="NAME"/></li>
  </xsl:template>
  
</xsl:stylesheet>

You can find this example in examples/roomtemp.xsl


View Transformed Document in Browser
Previous | Next | Top | Cafe con Leche

Copyright 2002 Elliotte Rusty Harold
Elliotte Rusty Harold
Last Modified October 16, 2002