Then how about option 'b' ?
At this point any way forward, any work around will do.
Please let me know if anyone has any suggestion.

What I don't understand is, if I can add nodes why can't I pick those nodes from another resource? Why is this not possible?

But I'm looking for some workaround.

Thanks for your help.
Anupam


From: Christian Grün <christian.gruen@gmail.com>;
To: Anupam Bakshi <bakshia@yahoo.com>;
Cc: <basex-talk@mailman.uni-konstanz.de>;
Subject: Re: [basex-talk] Nothing gets printed after insert node
Sent: Wed, Jun 6, 2012 12:24:18 AM

> I'm interested in 'a'.
> The two files are in basex, I need to write a query that will return the
> modified nodes at run time.

Due to the nature of the XQuery Update Specification, that's generally
not possible. Sorry for that.


> From: Christian Grün <christian.gruen@gmail.com>;
> To: Anupam Bakshi <bakshia@yahoo.com>;
> Cc: basex-talk@mailman.uni-konstanz.de
> <basex-talk@mailman.uni-konstanz.de>;
> Subject: Re: [basex-talk] Nothing gets printed after insert node
> Sent: Tue, Jun 5, 2012 9:09:06 PM
>
> Are you mostly interested in
>
> a) updating your data, and returning the modified node(s) as query result,
> or
> b) finding the correct updating query to modify your data?
> ___________________________
>
> > Here is what I actually want to do. Maybe someone can suggest a
> > straightforward way.
> >
> > File : sample1.xml
> > <P>
> >  <M id="1"/>
> >  <M id="2"/>
> >  <M id="3"/>
> > </P>
> >
> > File: result1.xml
> > <Q>
> >  <R id="1"/>
> >  <R id="2"/>
> > </Q>
> >
> > Desired output :
> > <P>
> >  <M id="1">
> >     <R id="1"/>
> >   </M>
> >   <M id="2">
> >     <R id="2"/>
> >   </M>
> >  <M id="3"/>
> > </P>
> >
> > So insert the node from 2nd file into 1st where the ids match.
> >
> > Thanks,
> > Amupam
> >
> > ________________________________
> > From: Christian Grün <christian.gruen@gmail.com>
> > To: Anupam Bakshi <bakshia@yahoo.com>
> > Cc: basex-talk@mailman.uni-konstanz.de
> > Sent: Tuesday, June 5, 2012 12:02 PM
> > Subject: Re: [basex-talk] Nothing gets printed after insert node
> >
> >> Unfortunately I did not see how I can return the value into a variable
> >> for
> >> further processing.
> >> Is there some other way to do it?
> >
> > Did you already try db:output()?
> >
> >