W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2010

Re: [XQuery 1.1] XML-mapping support and explicit parallel FLWOR

From: Semyon Chertkov <semyonc@gmail.com>
Date: Tue, 21 Sep 2010 13:50:12 +0400
Message-ID: <AANLkTi=R6uk+Q0hsmMtTrtejWV_cecw9hcLt0Gvnq1br@mail.gmail.com>
To: Michael Kay <mike@saxonica.com>
Cc: public-qt-comments@w3.org
You are right. But take a look at result mapping and compare it with
suggested

<root>
  {
     doc("data1.xml")/doc/
 (
   a/<field1>{text()}</field1>,
   <detail>
   {
     for $a in b[1]
                return attribute atr1 { $a },
      table/row/<line>
    {
    column1/<A>{text()}</A>,
    column2/<B>{text()}</B>
       }
  </line>
   }
   </detail>
 )
  }
</root>

Semyon

2010/9/21 Michael Kay <mike@saxonica.com>

>  On 21/09/2010 9:36 AM, Semyon Chertkov wrote:
>
>> for $v in $r/column1
>>                    return <A>{ $v/text() } </A>
>>
> as:
>
> <A[column1]>{text()}</A>
>
> Note that you can already write
>
> column1/<A>{text()}</A>
>
> The only problem with this is that "/" sorts into document order, which in
> the case of newly constructed nodes is implementation-dependent. If we had a
> "simple mapping operator" (say "\", as has been proposed and rejected in the
> past), then I think
>
> column1\<A>{text()}</A>
>
> would be equivalent to your suggestion and far more general in its
> capability. (It's essentially a "for" expression that sets the context item
> rather than a range variable).
>
> Michael Kay
> Saxonica
> (personal response only)
>
>
>
Received on Tuesday, 21 September 2010 09:53:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:06 GMT