BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
XSLT
The Understanding XSL Game
Dynamic functions: Functional combination, partial application and lambda expressions
XSLT Stylesheets, find over 100 example XSLT stylesheets
XSLT - Creating Links and Cross-References
XML in a Nutshell - XPath
The XPath Function: node-set unparsed-entity-url ( string )
The XPath Function: boolean true ( )
The XPath Function: string translate ( string, string, string )
The XPath Function: object system-property ( string )
The XPath Function: number sum ( node-set )
The XPath Function: string substring ( string, number, number? )
The XPath Function: string substring-before ( string, string )
The XPath Function: string substring-after ( string, string )
The XPath Function: string string ( object? )
The XPath Function: number string-length ( string? )
The XPath Function: boolean starts-with ( string, string )
The XPath Function: number round ( number )
The XPath Function: number position ( )
The XPath Function: number number ( object? )
The XPath Function: boolean not ( boolean )
<< XQuery
.NET and XML >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/16/2004
Times viewed :8676

 
Page 1 of 11

 

  Table Of Contents Next Page

The Functional Programming Language XSLT - A proof through examples

Dimitre Novatchev (dnovatchev@yahoo.com)
November, 2001

  Get the printable PDF copy of this article (400 KB ZIP)

Until now it was believed that although XSLT is based on functional programming ideas, it is not as yet a full functional programming language, as it lacks the ability to treat functions as a first-class data type. Based on numerous concrete XSLT implementations of some of the major functional programming design patterns, including some of the most generic list-processing and tree-processing functions, this article provides ample proof that XSLT is in fact a full-pledged functional programming language. The presented code forms the base of a first XSLT functional programming library. It is emphasized that a decision to include higher-order functions support in XPath 2.0 will make functional programming in XSLT even more straightforward, natural and convenient.

  Using MSXML?  Get the MSXML source code!

  Using SAXON?  Get the SAXON source code!

  Using Xalan?  Get the Xalan source code!

Introduction

XSLT has turned out to be very different from the typical programming languages in use today. One question that's being asked frequently is: "What kind of programming language is actually XSLT?". Until now, the authoritative answer from some of the best specialists was that XSLT is a declarative (as opposed to imperative) but still not a functional programming (FP) language. Michael Kay notes in his article "What kind of language is XSLT" [3] :
"although XSLT is based on functional programming ideas, it is not as yet a full functional programming language, as it lacks the ability to treat functions as a first-class data type".

What has been done to bring XML and FP languages closer together? One notable direction is to add XML support to some well-known FP languages, such as the HaXML compiler and tools written in Haskell [6], the LambdaXML xml-based FP  language and the XML support in Erlang [2].

However, nothing is seemingly being done in the other direction -- to add functional programming capabilities to XSLT. The citation in the start of this section reflects the unanimous, dominating understanding of XSLT as a declarative-only programming language, which does not belong to the family of FP languages, due to its lack of support for higher order functions.

The purpose of this article is to demonstrate beyond any doubt that XSLT is a functional programming language in its own right. To achieve this goal, a reference XSLT implementation is provided of major FP concepts and functions. This article closely follows the contents and layout of John Hughes' article "Why functional programming matters" [1], in which some most typical and useful FP patterns and functions are defined. This article provides an XSLT implementation of most of the functions defined in [1].  Therefore, the reader is encouraged to read [1] either prior, or side-by-side with the current article.

 

Page 1 of 11

 

  Table Of Contents Next Page

Rate this article on a scale of 1 to 10

Your vote :  


 

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
help desk
Domain Names
help desk services
Dolce&gabbana 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