This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Re: Re: A question about the expressive power and limitations of XPath 2.0
- From: David Carlisle <davidc at nag dot co dot uk>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 13 Jan 2002 15:30:46 GMT
- Subject: Re: [xsl] Re: Re: A question about the expressive power and limitations of XPath 2.0
- References: <20020113140712.79671.qmail@web14502.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
> A general statement about what "for" cannot do: Any problem of sequence processing,
> which requires that the result of processing an item be used as input for processing
> the next item(s).
>
> Is this true?
yes I think so (ie you can't implement fold given map, more or less:-)
Of course you can generate a sequence of running totals using something
like
for $i in 1 to count($x)
return
sum($x[position() <= $i])
but that's not really a "running total" as the first bits are repeatedly
re-avaluated, whereas what you'd like to do is pass a two argument
function over the list where at each stage the first argumant is the
previous result and teh second argument is the new item.
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list