[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

FLWOR in XSLT 2.0?

Evan Lenz Evan.Lenz at marklogic.com
Thu Dec 1 07:10:55 PST 2011


  FLWOR in XSLT 2.0?
It's the XPath subset of XQuery, which supports "for" expressions but not full FLWOR statements, to the sometime consternation of XSLT developers (e.g. having to switch to <xsl:for-each> and <xsl:variable> when all you really wanted was "let").

Evan

On Dec 1, 2011, at 7:03 AM, "Geert Josten" <http://x-query.com/mailman/listinfo/talk<mailto:http://x-query.com/mailman/listinfo/talk>> wrote:

Funny, I always thought the FLWOR was an XQuery only thing...

<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:b="books">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>

<xsl:template match="/">
  <xsl:sequence select=
  "(for $m in max(for $n in distinct-values(/*/b:book/(b:author |
b:editor)
                                           /b:name/concat(b:fname, '|',
b:lname)),
                  $cnt in count(/*/b:book/(b:author | b:editor)
                                /b:name[$n eq concat(b:fname, '|',
b:lname) ])

...

(Looks quite horrible to me, like someone couldn't decide between XQuery
and XSLT.. :-/)

Grtz

drs. G.P.H. (Geert) Josten
Senior Developer



Dayon B.V.
Delftechpark 37b
2628 XJ Delft

T +31 (0)88 26 82 570

http://x-query.com/mailman/listinfo/talk<mailto:http://x-query.com/mailman/listinfo/talk>
www.dayon.nl<http://www.dayon.nl>

De informatie - verzonden in of met dit e-mailbericht - is afkomstig van
Dayon BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan
dit bericht kunnen geen rechten worden ontleend.
_______________________________________________
http://x-query.com/mailman/listinfo/talk<mailto:http://x-query.com/mailman/listinfo/talk>
http://x-query.com/mailman/listinfo/talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://x-query.com/pipermail/talk/attachments/20111201/10d51061/attachment.html>


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-2011 All Rights Reserved.