... I used multiple statements in the modify function based on the documentation: http://docs.basex.org/wiki/Update

On Tue, Apr 26, 2011 at 11:23 AM, Sony Vijay <sony.vibh@gmail.com> wrote:
Yes, I tried the query without the return earlier. I saw a syntax error: [XPST0003] Expecting 'where', 'order' or 'return' expression.

I return $c in my query but I still see the error. Looking at the error, I guessed that when a transform function is used in a query, return is required to replace.

Also, I am using two return statements inside the modify function. I am not sure if that is allowed. In any event, is there a way to update multiple nodes at the same time with or without using modify.

Thanks,
Sony

On Tue, Apr 26, 2011 at 11:02 AM, Christian Grün <christian.gruen@gmail.com> wrote:
…still incorrect; "return" before "replace" doesn't make sense.
C.


On Tue, Apr 26, 2011 at 4:58 PM, Sony Vijay <sony.vibh@gmail.com> wrote:
> Hi Christian,
> The complete query is:
> let $node :=
>  copy $c :=
>    <entry>
>      <title>entry title</title>
>      <content>entry content</content>
>    </entry>
>  modify (
>    return replace value of node $c/title with 'new entry title',
>    return replace value of node $c/content with 'new entry content'
>  )
>  return $c
> return replace node doc('doc1')/entry with $node
> Note: doc1 is a document in the database with 'entry' as the root element.
> - Sony
> On Tue, Apr 26, 2011 at 10:40 AM, Christian Grün <christian.gruen@gmail.com>
> wrote:
>>
>> Sony,
>>
>> please provide complete queries, otherwise it's difficult to give
>> constructive feedback (e.g.: $entry isn't specified anywhere, etc).
>>
>> Christian
>>
>>
>> On Tue, Apr 26, 2011 at 3:59 PM, Sony Vijay <sony.vibh@gmail.com> wrote:
>> > Hi,
>> > I am wondering if there is a way to convert a String into a Node within
>> > XQuery.
>> > For example, consider the xquery
>> > let $node :=
>> >  copy $c :=
>> >    <entry>
>> >      <title>entry title</title>
>> >      <content>entry content</content>
>> >    </entry>
>> >  modify (
>> >    return replace value of node $entry/title with 'new entry title',
>> >    return replace value of node $entry/content with 'new entry content'
>> >  )
>> >  return $c
>> >
>> > return replace node doc('doc1')/entry with $c
>> > The above xquery throws the error: [XPTY0019] Context node required for
>> > entry; xs:string found. How do I fix this ?
>> > Thanks,
>> > Sony
>> >
>> > _______________________________________________
>> > BaseX-Talk mailing list
>> > BaseX-Talk@mailman.uni-konstanz.de
>> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
>> >
>> >
>
>