Re: [xsl] What is exciting in XSLT 2.0 (Was: Re: [xsl] parameters in XSLT 2.0)

Subject: Re: [xsl] What is exciting in XSLT 2.0 (Was: Re: [xsl] parameters in XSLT 2.0)
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 9 Jun 2005 06:26:42 +1000
On 6/8/05, Bruce D'Arcus <bdarcus@xxxxxxxxx> wrote:
>
> On Jun 8, 2005, at 8:40 AM, James Fuller wrote:
>
> > to use functions.....you dont need a functional or math background, the
> > concept of a function is present in most modern programming
> > languages....
>
> Yes, I know this, and use them quite a bit in my stylesheets.  I was
> referring to the higher-order functions that Dmitre is interested in.
> The FXSL docs assume a fairly specific audience that is not me.
>
> > the FXSL approach is steeped in what is known as functional
> > programming,
> > which places function and function composition at the heart of
> > programming (flow, arch, data structure...)....by porting some of the
> > most popular functions from Lisp/Haskell Dimitre is able to draw from a
> > very deep well and well researched field of computing to solve problems
> > by using a functional approach.
>
> OK, but what kind of practical problems can it help solve for XSLT
> programmers?


Just look in this list. From time to time there appears a problem that
is difficult to solve (e.g. requires a lot of coding) for which the
solution using FXSL is straightforward and almost trivial.

  This happens quite often.

  All these problems are real and practical and asked by real XSLT
programmers.

Just to name a few types of problems: transform-and sum, trim, do
something N times, map a tree, map a string, get all intermediate
results, filter, fold a list (calculate with accumulation), ... etc.
-- this list can easily become very long.

Also, do note that an FXSL function/template usually solves a *whole
class of problems*, not just a single problem of this class.

This is usually how I am solving such problems when somebody asks:

  1.Determine in my head that this problem is of type X (such as
transform-and sum).

  2. Pick up the appropriate function from FXSL that solves this kind
of problems, get an appropriate test case or modify it to fit the new
specific problem.

  3. Run the test case to produce the wanted results

Note that almost no new programming is involved in this process --
most of what has to be done is to glue a few functions together.

This enables the XSLT programmer using FXSL to produce a solution in a
few minutes, when otherwise hours might be required or the task may be
seen as too difficult.


Cheers,
Dimitre Novatchev

Current Thread