XQUERY UPDATE question
Tuesday, 14 March 2017 · 6 messages · last reply 16 Mar 2017
MB
mark bordelon14 Mar 2017 18:37 #
Guten Tag, die Herren!
I have a question about how I can insert, replace a node with a DOM node, instead of the text of that node. Right now when I
1) execute from the basex shell this command:
xquery replace value of node /text//sent[@id=15] with <sent id=15><clause><word/><word/><word/></clause></sent>
2) and then look at that node again with
xquery /text//sent[@id=15]i see that the dom has been converted into a text node of <sent id=15><clause><word/><word/><word/></clause></sent> How can I replace with true DOM and not have it convert to text?
CG
Christian Grün14 Mar 2017 18:45 #
Just use "replace node" instead of "replace value of node". Feel free to check out our documentation, it contains more information.
Quoted text · mark bordelon · 21 lines
Am 14.03.2017 18:42 schrieb "mark bordelon" <markcbordelon at yahoo.com>: > Guten Tag, die Herren! > > I have a question about how I can insert, replace a node with a DOM node, > instead of the text of that node. > > Right now when I > > 1) execute from the basex shell this command: > > *xquery replace value of node /text//sent[@id=15] with* *<sent > id=15><clause><word/><word/><word/></clause></sent>* > > 2) and then look at that node again with > > *xquery /text//sent[@id=15]* > i see that the dom has been converted into a text node of *<sent > id=15><clause><word/><word/><word/></clause></sent>* > > How can I replace with true DOM and not have it convert to text? >
MB
mark bordelon14 Mar 2017 18:50 #
Thank you, Christian.
I expected it to be that easy.
From: Christian Grün <christian.gruen at gmail.com>
To: mark bordelon <markcbordelon at yahoo.com>
Cc: BaseX <basex-talk at mailman.uni-konstanz.de>
Sent: Tuesday, March 14, 2017 1:45 PM
Subject: Re: [basex-talk] XQUERY UPDATE question
Just use "replace node" instead of "replace value of node". Feel free to check out our documentation, it contains more information.
Quoted text · Christian Grün · 25 lines
Am 14.03.2017 18:42 schrieb "mark bordelon" <markcbordelon at yahoo.com>: > Guten Tag, die Herren! > > > I have a question about how I can insert, replace a node with a DOM node, instead of the text of that node. > > > Right now when I > > > 1) execute from the basex shell this command: > > > xquery replace value of node /text//sent[@id=15] with <sent id=15><clause><word/><word/>< word/></clause></sent> > > > > 2) and then look at that node again with > > > xquery /text//sent[@id=15] > i see that the dom has been converted into a text node of <sent id=15><clause>< word/><word/>< word/></clause></ sent> > > > How can I replace with true DOM and not have it convert to text?
MB
mark bordelon16 Mar 2017 18:50 #
Another question about a procedure.I would like to back up my Basex database to S3, but as the xml files.I know that I can individually get texts with xquery db:open but was looking for a one-command version from the command line to export all files in their databases to the filesystem. Can someone point me to docs or give an example?
Thanks
CG
Christian Grün16 Mar 2017 18:53 #
Did you already check out the Commands article in our documentation?
Quoted text · mark bordelon · 11 lines
Am 16.03.2017 18:50 schrieb "mark bordelon" <markcbordelon at yahoo.com>: > Another question about a procedure. > I would like to back up my Basex database to S3, but as the xml files. > I know that I can individually get texts with xquery db:open but was > looking for a one-command version from the command line to export all files > in their databases to the filesystem. > > Can someone point me to docs or give an example? > > Thanks >
BD
Hi Mark,
Quoted text · mark bordelon · 10 lines
On Thu, Mar 16, 2017 at 1:50 PM, mark bordelon <markcbordelon at yahoo.com> wrote: > Another question about a procedure. > I would like to back up my Basex database to S3, but as the xml files. > I know that I can individually get texts with xquery db:open but was > looking for a one-command version from the command line to export all files > in their databases to the filesystem. > > Can someone point me to docs or give an example? >
See the EXPORT command [1]. It can be used in several ways [2].
Quoted text · mark bordelon · 3 lines
> > Thanks >
Hope that helps!
Best,
Bridger
[1] http://docs.basex.org/wiki/Commands#EXPORT
[2] http://docs.basex.org/wiki/Database_Module#db:export
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery