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

RE: Esoteric XSLT/FXSL question

Subject: RE: Esoteric XSLT/FXSL question
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 28 May 2008 21:30:29 +0100
RE:  Esoteric XSLT/FXSL question
> Now, the FP alphabet of functions includes as its signature 
> functions, "map", "fold" (aka "reduce") and so on.
> 
> However "so on" rarely includes "foreach" as a signature 
> function of the FP idiom.  Is this because "foreach" implies 
> some kind of time ordered calculation, and therefore not optimizable?

xsl:for-each is essentially a map() or apply() function. More specifically

<xsl:for-each select="S">
  <instructions/>
</xsl:for-each>

is equivalent to the higher-order function call map(S, instructions) where
"instructions" is interpreted as a function applied to the context node.

The use of the English words "for each" is a mixed blessing. On the one
hand, it makes your typical user less uncomfortable than if it were named
xsl:map. On the other hand, it gives people the wrong impression that it is
procedural.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.