Hi,
Under BaseX 772.
I have to run 2 update operations in one query (both concern the same target element)
- first operation example: *replace node //tei:div[@xml:id="myID"]with <div ns:time='xxx' xml:id="myID">new content</div>*
- second operation example:* **replace value of node //tei:div[@xml:id="myID"]/@*:time with "yyy"** * Both work when run separatly, but don't when are in the same query: the second operation is not executed (and no error message is returned) * **replace node //tei:div[@xml:id="myID"]with <div ns:time='xxx' xml:id="myID">new content</div>,** **replace value of node //tei:div[@xml:id="myID"]/@*:time with "yyy"*
Any idea? Is it a bug?
Regards,
Jérôme C.
Hi Jérôme,
no, this is intended behavior and compliant to the XQuery Update spec. Update will be appended to a Pending Update List (PUL) and executed at the end of the query in a certain order. There is some more information given at https://docs.basex.org/wiki/Updates#Pending_Update_List and the order of operations as well.
There you cann see that "replace value" is actually applied before "replace", although it is in a different order within your query. So in the end your query will update the value and then replace the whole node. Hence, the second operation is in fact executed, but the effect of this operation is overwritten.
Cheers, Dirk
On 27/02/14 16:13, Jérôme Chauveau wrote:
Hi,
Under BaseX 772.
I have to run 2 update operations in one query (both concern the same target element)
- first operation example:
*replace node //tei:div[@xml:id="myID"]with <div ns:time='xxx' xml:id="myID">new content</div>*
- second operation example:*
**replace value of node //tei:div[@xml:id="myID"]/@*:time with "yyy"**
Both work when run separatly, but don't when are in the same query: the second operation is not executed (and no error message is returned)
**replace node //tei:div[@xml:id="myID"]with <div ns:time='xxx' xml:id="myID">new content</div>,** **replace value of node //tei:div[@xml:id="myID"]/@*:time with "yyy"*
Any idea? Is it a bug?
Regards,
Jérôme C.
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
basex-talk@mailman.uni-konstanz.de