xquery replace
Sunday, 28 March 2010 · 5 messages · last reply 29 Mar 2010
AW
Hi Travis,
all xquery operations are atomic.
If you want to replace the value of the node you have to write the query as following:
-> xquery replace value of node root()/child with "new data"
I hope this helps, as first advice.
Feel free to ask for more,
Andreas, BaseX Team
Quoted text · Travis Webb · 33 lines
Travis Webb schrieb: > Also, is the 'replace' operation atomic? > > -tjw > > On Sun, Mar 28, 2010 at 3:47 PM, Travis Webb <tjwebb at vt.edu > <mailto:tjwebb at vt.edu>> wrote: > > I am trying to use xquery replace but cannot, it seems, figure out > the correct syntax. As I understand it, the replace query should > be of the form: "xquery replace expr with node", so I'm trying to > do the following: > > > xquery replace root()/child with <child>new data</child> > Stopped at line 1, column 15: > Syntax: XQUERY [query] > Evaluate XQuery. > > I've tried a number of variations but I get the same error. Any > ideas? Thanks. > > -tjw > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
TW
Travis Webb28 Mar 2010 23:46 #
I am trying to use xquery replace but cannot, it seems, figure out the correct syntax. As I understand it, the replace query should be of the form: "xquery replace expr with node", so I'm trying to do the following:
Quoted text · 1 line
> xquery replace root()/child with <child>new data</child>
Stopped at line 1, column 15:
Syntax: XQUERY [query]
Evaluate XQuery.
I've tried a number of variations but I get the same error. Any ideas? Thanks.
-tjw
CG
Quoted text · Travis Webb · 5 lines
> Ok, thanks for the quick response. I wanted to make sure repalce wasn't just > an insert/remove sequence which would make it unatomic. > How would I replace the node with a completely new one? So if I didn't want > to just replace the 'value of', how would I do that? > -tjw
…just omit the "value of" keywords; find more at e.g.
http://www.w3.org/TR/xquery-update-10-use-cases/
All the best,
Christian
TW
Also, is the 'replace' operation atomic?
-tjw
Quoted text · Travis Webb · 18 lines
On Sun, Mar 28, 2010 at 3:47 PM, Travis Webb <tjwebb at vt.edu> wrote: > I am trying to use xquery replace but cannot, it seems, figure out the > correct syntax. As I understand it, the replace query should be of the form: > "xquery replace expr with node", so I'm trying to do the following: > > > xquery replace root()/child with <child>new data</child> > Stopped at line 1, column 15: > Syntax: XQUERY [query] > Evaluate XQuery. > > I've tried a number of variations but I get the same error. Any ideas? > Thanks. > > -tjw > > > >
TW
Ok, thanks for the quick response. I wanted to make sure repalce wasn't just an insert/remove sequence which would make it unatomic.
How would I replace the node with a completely new one? So if I didn't want to just replace the 'value of', how would I do that?
-tjw
Quoted text · Andreas Weiler · 51 lines
On Sun, Mar 28, 2010 at 4:00 PM, Andreas Weiler < andreas.weiler at uni-konstanz.de> wrote: > Hi Travis, > > all xquery operations are atomic. > > If you want to replace the value of the node you have to write the query as > following: > > -> xquery replace value of node root()/child with "new data" > > I hope this helps, as first advice. > > Feel free to ask for more, > Andreas, BaseX Team > > Travis Webb schrieb: > >> Also, is the 'replace' operation atomic? >> -tjw >> >> On Sun, Mar 28, 2010 at 3:47 PM, Travis Webb <tjwebb at vt.edu <mailto: >> tjwebb at vt.edu>> wrote: >> >> I am trying to use xquery replace but cannot, it seems, figure out >> the correct syntax. As I understand it, the replace query should >> be of the form: "xquery replace expr with node", so I'm trying to >> do the following: >> >> > xquery replace root()/child with <child>new data</child> >> Stopped at line 1, column 15: Syntax: XQUERY [query] >> Evaluate XQuery. >> >> I've tried a number of variations but I get the same error. Any >> ideas? Thanks. >> >> -tjw >> >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> >> > >
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery