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

Pierrick Brihaye pierrick.brihaye at culture.gouv.fr
Wed Jul 6 10:21:43 PDT 2005


Hi,

Peter Coppens <Peter.Coppens at ...> writes:

> Although position() can refer to atomic items, the '/' operator can not.
> So, the item(s) '/' operates on (the left hand side) has(have) to be a
> node(s). That is also why the error correctly refers to '/'.

Thanks. Very clear.

Now, what about the following error :

Error
  XPDY0002: The context position is currently undefined
Query processing failed: Run-time errors were reported

returned by :

let $myStrings := ("string1", "string2", "string3") 
for $string in $myStrings
order by position()
return $string

Well, this example is a bit silly but I try to find examples where position() is
not used in a predicate.

Cheers,

p.b.







More information about the talk mailing list