[xquery-talk] Re: position() and atomic values

Michael Rys mrys at microsoft.com
Wed Jul 6 08:52:05 PDT 2005


current-dateTime() unlike position() is not a context item dependent
function.

Best regards
Michael

> -----Original Message-----
> From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On
Behalf
> Of Pierrick Brihaye
> Sent: Wednesday, July 06, 2005 6:24 AM
> To: talk at xquery.com
> Subject: [xquery-talk] Re: position() and atomic values
> 
> Hi,
> 
> Michael Kay <mhk at ...> writes:
> 
> > It's very hard to come up with plausible examples for using
position()
> > outside a predicate in XQuery
> 
> Indeed :-) The same for last() I presume. So... what make them
different
> from
> the other "Context Functions" (http://www.w3.org/TR/xpath-
> functions/#context) ?
> 
> let $a := ("a","b","","d")
> for $b in $a
> return
>   fn:current-dateTime()
> 
> ... returns no error whereas...
> 
> let $a := ("a","b","","d")
> for $b in $a
> return
>   position()
> 
> ...does.
> 
> > position(), like ., plays little role in FLWOR expressions because
> unlike
> > xsl:for-each in XSLT, a "for" expression does not change the focus.
Only
> "/"
> > and "[]" change the focus in XQuery.
> 
> That's what I was missing... thank you for the clarification.
> 
> Cheers,
> 
> p.b.
> 
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk



More information about the talk mailing list