[xquery-talk] simple map operator

Jens Østergaard Petersen oesterg at gmail.com
Mon Jul 9 01:43:12 PDT 2012


Thanks, Michael,

If the simple map operator "does not locate any special nodes within trees, but works on sequences of items you specify by expressions", does that not make it into a sequence expression in the terms of Michael Kay's Reference, Chapter 10 (which also has "/" as a simple mapping expression when it works on atomic values)? Also, the draft defines a path expression as something that "can be used to locate nodes within trees", so I still wonder what the meaning behind this categorisation is.

Cheers,

Jens

On Jul 9, 2012, at 10:01 AM, Michael Seiferle wrote:

> Hi Jens, 
> 
> they are relative, such that each step (E1 ! E2) will serve as the input sequence E'1 for the next operation (E'1 ! E'2), hence:
> 
>> <foo>
>>  <bar>hello</bar>
>>  <bar>world</bar>
>>  <bar>and</bar>
>>  <bar>hello</bar>
>>  <bar>universe</bar>
>> </foo>/bar ! (: here we locate each <bar /> child of <foo /> :)
>>    upper-case(.) !  (: we return a sequence of their text() in upper-case :)
>>          substring(.,2,string-length(.)) (: we return a sequence of the upper case text and strip the first character :)
> the map operator redefines the context items (inner focus) for each subsequent operation. 
> 
> So it does not locate any special nodes within trees, but works on sequences of items you specify by expressions, for example:
>> (1 to 5) ! (. + 1) ! (. * 2)
> will work as well and returns (4, 6, 8, 10, 12).
> 
> Hope this helped to clear things up a little :-).
> I guess others on this list will correct me if I got something wrong.
> 
> Kind regards
> 
> Michael
> 
> 
> 
> Am 09.07.2012 um 09:41 schrieb Jens Østergaard Petersen:
> 
>> Hi,
>> 
>> Can anyone explain to me why the XQuery 3.0 simple map operator <http://www.w3.org/TR/xquery-30/#id-map-operator> is a relative path expression? Which nodes within trees does it locate?
>> 
>> Thanks in advance for any enlightenment,
>> 
>> Jens
>> _______________________________________________
>> talk at x-query.com
>> http://x-query.com/mailman/listinfo/talk
> 




More information about the talk mailing list