[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: A question about the expressive power and limi

Subject: Re: Re: A question about the expressive power and limitations of XPath 2.0
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sun, 13 Jan 2002 06:07:12 -0800 (PST)
 Re: Re: A question about the expressive power and limi
> > As I'm just starting to read the latest WDs, I'd greatly appreciate
> > it if somebody could provide examples showing:
> >
> > 1. A problem, which cannot be easily solved by using "for", but
> > which has a natural recursive solution. Calling user-defined
> > functions within an XPath expression must be excluded, as we can do
> > anything (e.g. recursion) within a user-defined function.
> Perhaps the implementation of a math:power function? You can do that
> with recursion using:
> <xsl:function name="math:power">
>   <xsl:param name="base" type="xs:float" select="1" />
>   <xsl:param name="power" type="xs:integer" select="0" />
>   <xsl:result select="if ($power = 0)
>                       then 1
>                       else $base * math:power($base, $power - 1)" />
> </xsl:function>

Hi Jeni,

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?

Then an example with sales and having to compute the total sum, but also having to
maintain a ***running total*** seems most close to earth.

Do you see anything wrong in my reasoning?


Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.