Re: [xsl] Aborting XSL processing during a run....

Subject: Re: [xsl] Aborting XSL processing during a run....
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sat, 12 Feb 2005 11:26:13 +1100
This is one thing that is not very easy to do in a functional
language, as it implies a definite order of evaluation (processing),
while by definition order of evaluation is not deterministic in a
functional language.

The way to do this is to use explicit control structures/functions
that ensure a predefined order of evaluation.

When you have implemented an "environment" and a sequential
interpreter, then the interpreter can check the result of every
evaluation (the value of a special "exception" variable in the
environment will be set to true) and in an exception situation the
interpreter will either initiate an available "exception handler" step
out of sequence, or if there's no such exception handler available,
the interpreter will itself set to true the exception state in its own
environment and return controll to its initiator.

Such an interpreter can be implemented (as I did two years ago)  in
XSLT following the approach of a Monad class used in other functional
programming languages such as Haskell.

Of course, this is a heavy weaponry and will be mainly needed in cases
of transactional processing, almost always associated with calling
extension functions in the steps of an interpreted sequence.

And just having your own sequential interpreter is obviously not
sufficient, as one may be using a 3rd party function library that
doesn't know anything about sequencing, environments and exception
states. Such a capability has to be standard.

A good topic for XPath 3.0 / XSLT 3.0 


Dimitre Novatchev.

On Fri, 11 Feb 2005 15:48:29 +0100, ben senior <ben@xxxxxxxxxxxxx> wrote:
> Greetings all...
> We're using XSL to generate PHP code. Given a particular irregularity in
> the incoming XML (a missing attribute) we would like to output a PHP
> line (to throw an exception) and then to STOP the processing then and
> there (match nothing more and end) but without the processing 'crashing'.
> I've looked through my XSL books but not come up with anything...
> Does anybody have a suggestion?
> Kindest Regards,
> Ben

Current Thread