BizTalk Utilities CV ,   Jobs ,   Code library  
 
 
Page 7 of 11

 

Previous Page Table Of ContentsNext Page

The Functional Programming Language XSLT - A proof through examples

Advanced XSLT FP applications

In this section we provide the XSLT implementation of some advanced numerical algorithms by using essentially higher order functions for list processing and list generation. Essentially used in these implementations is a function within , which is passed a list-generator function and a tolerance as parameters. within  uses the buildListWhile function with the list-generator passed to it as parameter and with its own controller function, which triggers the stop condition, whenever the difference between the last two generated list elements becomes less than the tolerance parameter eps.

Here's the XSLT implementation of within:

 <xsl:stylesheet version = "1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:MyWithinEpsController="MyWithinEpsController"
    exclude-result-prefixes = "xsl msxsl MyWithinEpsController"
>

         <xsl:import href = "buildListWhile.xsl" />

         <MyWithinEpsController:MyWithinEpsController/>

         <xsl:variable name = "vMyWithinEpsController" 
                      select = "document('')/*/MyWithinEpsController:*[1]"
/>

         <xsl:template name = "within" >
             <xsl:param name = "pGenerator" select = "/.." />
             <xsl:param name = "pParam0" select = "/.." />
             <xsl:param name = "Eps" select = "0.1" />

             <xsl:variable name = "vResultList" >
                 <xsl:call-template name = "buildListWhile" >
                     <xsl:with-param name = "pGenerator" 
                                    select = "$pGenerator"
/>
                     <xsl:with-param name = "pParam0" select = "$pParam0" />
                     <xsl:with-param name = "pController" 
                                    select = "$vMyWithinEpsController"
/>
                     <xsl:with-param name = "pContollerParam" select =  ;"$Eps" />
                 </xsl:call-template>
             </xsl:variable>

             <xsl:value-of select = "msxsl:node-set($vResultList)/*[last()]" />
         </xsl:template>

         <xsl:template name = "MyWithinEpsController" 
                      match = "*[namespace-uri()='MyWithinEpsController']"
>

             <xsl:param name = "pList" select = "/.." />
             <xsl:param name = "pParams" />

             <xsl:choose>
                 <xsl:when test = "count($pList) &lt; 2" >1</xsl:when>
                 <xsl:when test = "count($pList) >= 2" >
                     <xsl:variable name = "lastDiff" 
                                  select = "$pList[last()] - $pList[last() - 1]"
/>
                     <xsl:if test = "not($lastDiff &lt;= $pParams and $lastDiff >= (0 - $pParams))" >1
                    </xsl:if>
                 </xsl:when>
                 <xsl:otherwise>1</xsl:otherwise>
             </xsl:choose>
         </xsl:template>

     </xsl:stylesheet>

Page 7 of 11

 

Previous Page Table Of ContentsNext Page
 

Recent Jobs

Integration Specialist Needed - Wor
Virtualization Server Infrastructur
A great opportunity to Digital Vide
here is a greate opportunity as a S
A great opportunity as a Network En

View all Jobs (Add yours)
View all CV (Add yours)




swimming pool contractor
chicago web site design
teleconferencing services
Web Hosting
online fax service
Calvin klein sunglasses
answering service


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP