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

Re: A beef with XSLT Sometimes too complicated

Subject: Re: A beef with XSLT Sometimes too complicated
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 14 Jul 2006 20:49:02 +0100
Re:  A beef with XSLT Sometimes too complicated
> for $i in (for $j in $someSeq return some($j)) return ...?
sorry you can nest as many for as you like but it can't be done (I
claim)

> But I'm really not even sure I follow what you math-heads are getting 

in xquery you can go
let $s := (1,2,3)
return
count($s)

and get 3

in xslt you can go

<xsl:variable name="s" select="(1,2,3)"/>
<xsl:sequence select="count($s)"/>

and get 3 as well.

But in XPath You don't have all of XQuery's FLWOR
(For-Let-Where-OrderBy-Return) expression, in particular you don't have
the Let clause so you can't go

let $s := (1,2,3)


if you have an xquery that binds a single item to a variable 
let $i := count(foo)
return .....$s
then you can do the same binding in XPath by replacing the let by a for
for $s in count(foo)
return .... $s

but if the let clause is binding the variable to a sequence of zero or
more than one items there is no way to bind that sequence to a variable
in Xpath. All the XPath binding expressions, namely for, some, every
iterate through a sequence and bind the variable to (at eaxh iteration)
a single item. This is often annoying (if you get annoyed by such
things).

David

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.