Nothing gets printed after insert node

Tuesday, 5 June 2012 · 4 messages
CG
Christian Grün5 Jun 2012 18:02 #
Quoted text · 2 lines
> 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()?
AB
Anupam Bakshi5 Jun 2012 22:01 #
Sorry, I don't understand how db:output() can be used to print out the modified nodes. I can use it to print some message but if I print out the nodes, it prints out the un-modified nodes. Basically I'm creating a processing pipeline, so the output of this insertion will be processed further by another piece of code. But I can't seem to capture the result of the insertion into a variable so that I can process it further. Maybe there is another way to do such type of processing. Maybe I should just do this type of work in XSLT. Any guidance will be appreciated. Anupam ________________________________ From: Christian Grün <christian.gruen at gmail.com> To: Anupam Bakshi <bakshia at yahoo.com> Cc: basex-talk at mailman.uni-konstanz.de Sent: Tuesday, June 5, 2012 12:02 PM Subject: Re: [basex-talk] Nothing gets printed after insert node
Quoted text · Christian Grün · 2 lines
> 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()?
AB
Anupam Bakshiin reply to Christian Grün, 5 Jun 2012, 18:025 Jun 2012 23:02 #
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 at gmail.com> To: Anupam Bakshi <bakshia at yahoo.com> Cc: basex-talk at mailman.uni-konstanz.de Sent: Tuesday, June 5, 2012 12:02 PM Subject: Re: [basex-talk] Nothing gets printed after insert node
Quoted text · Christian Grün · 2 lines
> 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()?
CG
Christian Grün5 Jun 2012 23:09 #
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?
Quoted text · Anupam Bakshi · 46 lines
> 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 at gmail.com> > To: Anupam Bakshi <bakshia at yahoo.com> > Cc: basex-talk at 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()? > >

⚡Generated with XQuery