home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F31610_testAllSomeTrue.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  1.3 KB  |  49 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.   <xsl:import href="allTrue.xsl"/>
  3.   <xsl:import href="someTrue.xsl"/>
  4.   
  5.   <xsl:output omit-xml-declaration="yes"/>
  6.   <!-- This transformation must be applied to:
  7.         boolNodes.xml 
  8.    -->
  9.   
  10.   <xsl:template match="/">
  11.     <xsl:variable name="allTrue">
  12.         <xsl:call-template name="allTrue">
  13.           <xsl:with-param name="pList" select="/*/*"/>
  14.         </xsl:call-template>
  15.     </xsl:variable>
  16.     
  17.     <xsl:if test="not(string($allTrue))">
  18.       <xsl:text>Not </xsl:text>
  19.     </xsl:if>
  20.     <xsl:value-of select="'all nodes contents are true in:'"/>
  21.     <xsl:text> </xsl:text>
  22.     <xsl:copy-of select="/*/*"/>
  23.  
  24.     <xsl:text> </xsl:text>
  25.        
  26.     <xsl:variable name="someTrue">
  27.         <xsl:call-template name="someTrue">
  28.           <xsl:with-param name="pList" select="/*/*"/>
  29.         </xsl:call-template>
  30.     </xsl:variable>
  31.     
  32.     <xsl:value-of select="$someTrue"/>
  33.     <xsl:text> </xsl:text>
  34.  
  35.     <xsl:choose>
  36.         <xsl:when test="not(string($someTrue))">
  37.           <xsl:text>None are true</xsl:text>
  38.         </xsl:when>
  39.         <xsl:otherwise>
  40.           <xsl:text>Some are true</xsl:text>
  41.         </xsl:otherwise>
  42.     </xsl:choose>
  43.     
  44.     <xsl:text> </xsl:text>
  45.     <xsl:copy-of select="/*/*"/>
  46.      
  47.   </xsl:template>
  48. </xsl:stylesheet>
  49.