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

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. xmlns:myFunction="myFunction" 
  3. exclude-result-prefixes="xsl myFunction"
  4. >
  5.   <xsl:import href="easyDiffList.xsl"/>
  6.   
  7.   <!-- To be applied on any xml. This produces the derivative of
  8.        x^2 for x = 15, with precision 0.000001
  9.    -->
  10.  
  11.   <xsl:output indent="yes" omit-xml-declaration="yes"/>
  12.   
  13.   <myFunction:myFunction/>
  14.   
  15.   <xsl:template match="/">
  16.     <xsl:variable name="vMyFun" select="document('')/*/myFunction:*[1]"/>
  17.     
  18.     <xsl:call-template name="easyDiffList">
  19.         <xsl:with-param name="pFun" select="$vMyFun"/>
  20.         <xsl:with-param name="pX" select="15"/>
  21.         <xsl:with-param name="pH0" select="0.1"/>
  22.         <xsl:with-param name="pEps" select="0.000001"/>
  23.     </xsl:call-template>
  24.   
  25.   </xsl:template>
  26.  
  27.   <xsl:template name="myFunction" match="*[namespace-uri()='myFunction']">
  28.      <xsl:param name="pParam" select="/.."/>
  29.      
  30.      <xsl:value-of select="$pParam * $pParam"/>
  31.   </xsl:template>
  32.  
  33. </xsl:stylesheet>