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 / F32930_testSimpleIntegration.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-01-20  |  3.1 KB  |  95 lines

  1. <xsl:stylesheet version="1.0"
  2.  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:IntegralFunction="IntegralFunction"
  4. xmlns:IntegralFunction2="IntegralFunction2"
  5. xmlns:IntegralFunction3="IntegralFunction3"
  6. xmlns:IntegralFunction4="IntegralFunction4"
  7.  exclude-result-prefixes="xsl IntegralFunction IntegralFunction2
  8.  IntegralFunction3 IntegralFunction4"
  9. >
  10.  
  11.   <xsl:import href="simpleIntegration.xsl"/>
  12.  
  13.   <!-- <xsl:output method="html" encoding="UTF-8"/> -->
  14.  
  15.   <IntegralFunction:IntegralFunction/>
  16.   <IntegralFunction2:IntegralFunction2/>
  17.   <IntegralFunction3:IntegralFunction3/>
  18.   <IntegralFunction4:IntegralFunction4/>
  19.  
  20.   <xsl:template match="/">
  21.  
  22.     <br />1
  23.     <br />∫ x² =
  24.     <xsl:variable name="vMyFun" select="document('')/*/IntegralFunction:*[1]"/>
  25.     <xsl:call-template name="simpleIntegration">
  26.       <xsl:with-param name="pFun" select="$vMyFun"/>
  27.       <xsl:with-param name="pA" select="0"/>
  28.       <xsl:with-param name="pB" select="1"/>
  29.       <xsl:with-param name="pEpsRough" select="0.0001"/>
  30.     </xsl:call-template>
  31.     <br />0
  32.  
  33.     <br />
  34.     <br />1
  35.     <br />∫ x³ =
  36.     <xsl:variable name="vMyFun2" select="document('')/*/IntegralFunction2:*[1]"/>
  37.     <xsl:call-template name="simpleIntegration">
  38.       <xsl:with-param name="pFun" select="$vMyFun2"/>
  39.       <xsl:with-param name="pA" select="0"/>
  40.       <xsl:with-param name="pB" select="1"/>
  41.       <xsl:with-param name="pEpsRough" select="0.0001"/>
  42.     </xsl:call-template>
  43.     <br />0
  44.  
  45.     <br />
  46.     <br />1
  47.     <br />∫ 4/(1 + x²) =
  48.     <xsl:variable name="vMyFun3" select="document('')/*/IntegralFunction3:*[1]"/>
  49.     <xsl:call-template name="simpleIntegration">
  50.       <xsl:with-param name="pFun" select="$vMyFun3"/>
  51.       <xsl:with-param name="pA" select="0"/>
  52.       <xsl:with-param name="pB" select="1"/>
  53.       <xsl:with-param name="pEpsRough" select="0.0001"/>
  54.     </xsl:call-template>
  55.     <br />0
  56.  
  57.     <br />
  58.     <br />2
  59.     <br />∫ 1/x =
  60.     <xsl:variable name="vMyFun4" select="document('')/*/IntegralFunction4:*[1]"/>
  61.     <xsl:call-template name="simpleIntegration">
  62.       <xsl:with-param name="pFun" select="$vMyFun4"/>
  63.       <xsl:with-param name="pA" select="1"/>
  64.       <xsl:with-param name="pB" select="2"/>
  65.       <xsl:with-param name="pEpsRough" select="0.0001"/>
  66.     </xsl:call-template>
  67.     <br />1
  68.  
  69.   </xsl:template>
  70.  
  71.   <xsl:template name="myIntegralFn" match="*[namespace-uri()='IntegralFunction']">
  72.     <xsl:param name="pX"/>
  73.  
  74.     <xsl:value-of select="$pX * $pX"/>
  75.   </xsl:template>
  76.  
  77.   <xsl:template name="myIntegralFn2" match="*[namespace-uri()='IntegralFunction2']">
  78.     <xsl:param name="pX"/>
  79.  
  80.     <xsl:value-of select="$pX * $pX * $pX"/>
  81.   </xsl:template>
  82.  
  83.   <xsl:template name="myIntegralFn3" match="*[namespace-uri()='IntegralFunction3']">
  84.     <xsl:param name="pX"/>
  85.  
  86.     <xsl:value-of select="4 div (1 + $pX * $pX)"/>
  87.   </xsl:template>
  88.  
  89.   <xsl:template name="myIntegralFn4" match="*[namespace-uri()='IntegralFunction4']">
  90.     <xsl:param name="pX"/>
  91.  
  92.     <xsl:value-of select="1 div $pX"/>
  93.   </xsl:template>
  94.  
  95. </xsl:stylesheet>