Hi,
Here is another thingy I tried but again: no cigar.
The problem would be solved if I could determine the absolute path to an element-variable: $c
Rob
Van: Christian Grün [mailto:christian.gruen@gmail.com] Verzonden: vrijdag 8 augustus 2014 16:04 Aan: Rob Stapper CC: BaseX Onderwerp: Re: [basex-talk] How to update a XML-file from itself?
Hi Rob,
I didnt find variable $c in your example, but the following modification might give you the correct result:
let $update.processor := function($a, $b) {
($a update replace value of node ./default/text1 with ())
update insert node $b/string into .//default/text1
}
or (depending on what you plan to do):
let $update.processor := function($a, $b) {
($a update insert node $b/string into default/text1)
}
As you already observed, it is only possible to update nodes that have been copied by the 'update' keyword.
Hope this helps,
Christian
On Fri, Aug 8, 2014 at 3:49 PM, Rob Stapper r.stapper@lijbrandt.nl wrote:
Hi,
Can anyone help me with this casus?
I want to update XML-source: $a, by inserting the content of XML-element: $b, a sub-element of $a, into XML-element: $c, also a sub-element of $a.
The relative path from $b to $c is known.
See attached example: the problem is that the update works on a copy of $a and that the destination-element: $b/parent::*/default/text1, is actually an element of the original $a.
How can I make it point to the corresponding element in the copy?
Any suggestions?
Thanx in advance,
Rob Stapper
_____
http://www.avast.com/ Afbeelding verwijderd door afzender.
Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus http://www.avast.com/ actief is.
--- Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus-bescherming actief is. http://www.avast.com