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
Also, is the 'replace' operation atomic?
-tjw
On Sun, Mar 28, 2010 at 3:47 PM, Travis Webb tjwebb@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
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@vt.edu mailto:tjwebb@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@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
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
On Sun, Mar 28, 2010 at 4:00 PM, Andreas Weiler < andreas.weiler@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@vt.edu mailto: tjwebb@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@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
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
basex-talk@mailman.uni-konstanz.de