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 / F43306_testMaximum.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  1.0 KB  |  36 lines

  1. <xsl:stylesheet version="1.0"
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:maximum-own-compare="maximum-own-compare"
  4. xmlns:Mycompare="Mycompare"
  5. exclude-result-prefixes="xsl Mycompare"
  6. >
  7.    <xsl:import href="maximum.xsl"/>
  8.    
  9.    <xsl:output method="text"/>
  10.    
  11.    <!-- This transformation must be applied to:
  12.         numList.xml 
  13.     -->
  14.    
  15.      <Mycompare:Mycompare/>
  16.  
  17.     <xsl:template match="/">
  18.       <xsl:variable name="vCMPFun" select="document('')/*/Mycompare:*[1]"/>
  19.  
  20.       <xsl:call-template name="maximum">
  21.         <xsl:with-param name="pList" select="/*/*"/>
  22.         <xsl:with-param name="pCMPFun" select="$vCMPFun"/> 
  23.  
  24.       </xsl:call-template>
  25.     </xsl:template>
  26.  
  27.     <xsl:template name="MyIsGreater" match="*[namespace-uri() = 'Mycompare']">
  28.          <xsl:param name="arg1"/>
  29.          <xsl:param name="arg2"/>
  30.  
  31.          <xsl:choose>
  32.           <xsl:when test="$arg1 < $arg2">1</xsl:when>
  33.           <xsl:otherwise>0</xsl:otherwise>
  34.          </xsl:choose>
  35.     </xsl:template>
  36. </xsl:stylesheet>