BaseX already looks/feels like a program I am going to enjoy using, even with the general challenge that I don't know enough about xQuery. I would welcome suggestions for anywhere to find a friendly introduction!
My first specific challenge is trying to under the syntax for replace. In the code, I've managed to retrieve a single xml document where <title> contains "35. Andan" … I made a copy/paste error, and in this document the value of title should be '35. Andantino' instead of '35. Andantino mesto'. My experiment is obviously incorrect, so I'd welcome tips on what's wrong with it.
//score[contains(title, '35. Andan')]//title replace value of (title) with '35. Andantino'
Thanks in advance!
Dear Niels,
Welcome on the list!
On Mon, Feb 2, 2015 at 2:42 PM, Niels Grundtvig Nielsen communicator.ngn@gmail.com wrote:
BaseX already looks/feels like a program I am going to enjoy using, even with the general challenge that I don't know enough about xQuery. I would welcome suggestions for anywhere to find a friendly introduction!
You could start having a look at [1] or [2].
My first specific challenge is trying to under the syntax for replace. [...]
//score[contains(title, '35. Andan')]//title replace value of (title) with '35. Andantino'
The following query should do what you want:
for $title in //score[contains(title, '35. Andan')]//title return replace value of node $title with '35. Andantino'
Here is yet another alternative:
for $title in //score/title[contains(., '35. Andan')] return replace value of node $title with '35. Andantino'
Feel free to check out our Wiki article on updates [3].
Hope this helps, Christian
[1] http://www.w3schools.com/xquery/ [2] http://docs.basex.org/wiki/XQuery [3] http://docs.basex.org/wiki/Updates
My first specific challenge is trying to under the syntax for replace. In the code, I've managed to retrieve a single xml document where <title> contains "35. Andan" … I made a copy/paste error, and in this document the value of title should be '35. Andantino' instead of '35. Andantino mesto'. My experiment is obviously incorrect, so I'd welcome tips on what's wrong with it.
//score[contains(title, '35. Andan')]//title replace value of (title) with '35. Andantino'
Thanks in advance!
Hi Niels,
BaseX has some very nice documentation in the wiki [1]. The WIkibooks XQuery document can be helpful[2] and Priscilla Walmsley's XQuery book is an absolutely fantastic reference.
Hope that's helpful. Cheers, Bridger
[1] http://docs.basex.org/wiki/XQuery [2] http://en.wikibooks.org/wiki/XQuery
On Mon, Feb 2, 2015 at 8:42 AM, Niels Grundtvig Nielsen < communicator.ngn@gmail.com> wrote:
BaseX already looks/feels like a program I am going to enjoy using, even with the general challenge that I don't know enough about xQuery. I would welcome suggestions for anywhere to find a friendly introduction!
My first specific challenge is trying to under the syntax for replace. In the code, I've managed to retrieve a single xml document where <title> contains "35. Andan" … I made a copy/paste error, and in this document the value of title should be '35. Andantino' instead of '35. Andantino mesto'. My experiment is obviously incorrect, so I'd welcome tips on what's wrong with it.
//score[contains(title, '35. Andan')]//title replace value of (title) with '35. Andantino'
Thanks in advance!
Hi Niels, Just confirming BaseX is very good. I've confronted its performance and support to the biggest open source alternative, which I won't mention its name here.
With kind regards, Menashè
On 02/02/2015 02:48 PM, Bridger Dyson-Smith wrote:
Hi Niels,
BaseX has some very nice documentation in the wiki [1]. The WIkibooks XQuery document can be helpful[2] and Priscilla Walmsley's XQuery book is an absolutely fantastic reference.
Hope that's helpful. Cheers, Bridger
[1] http://docs.basex.org/wiki/XQuery [2] http://en.wikibooks.org/wiki/XQuery
On Mon, Feb 2, 2015 at 8:42 AM, Niels Grundtvig Nielsen <communicator.ngn@gmail.com mailto:communicator.ngn@gmail.com> wrote:
BaseX already looks/feels like a program I am going to enjoy using, even with the general challenge that I don't know enough about xQuery. I would welcome suggestions for anywhere to find a friendly introduction! My first specific challenge is trying to under the syntax for replace. In the code, I've managed to retrieve a single xml document where <title> contains "35. Andan" … I made a copy/paste error, and in this document the value of title should be '35. Andantino' instead of '35. Andantino mesto'. My experiment is obviously incorrect, so I'd welcome tips on what's wrong with it. //score[contains(title, '35. Andan')]//title replace value of (title) with '35. Andantino' Thanks in advance!
basex-talk@mailman.uni-konstanz.de