Hi,
I’m testing BaseX and I have a very short question about XQuery Update Facility. If I try in other XQuery processor like Saxon a simple query that add a ‘id’ in XML, like this:
xquery version "1.0"; declare default element namespace "http://www.w3.org/1999/xhtml";
let $sourcedoc := fn:doc("MOST.xhtml") return for $ancora at $gatto in $sourcedoc//*[@class="testo"]
return if (not($ancora/@id)) then insert node attribute id {concat("testo",$gatto)} into $ancora else()
Saxon run the Query and change the original file, “MOST.xhtml”. If I try the same query in XBase on Ubuntu, I see in the log XBase find the tag to add the id, but the original file is not changed. What I’m missing?
Thank you
Fabrizio
Hi Fabrizio,
By default, updates will not be written back to documents in the file system. However, this feature can be activated with the -u command-line option [1].
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Command-Line_Options#Standalone
On Fri, May 8, 2015 at 11:34 AM, Fabrizio Venerandi fabrizio.venerandi@quintadicopertina.com wrote:
Hi,
I’m testing BaseX and I have a very short question about XQuery Update Facility. If I try in other XQuery processor like Saxon a simple query that add a ‘id’ in XML, like this:
xquery version "1.0"; declare default element namespace "http://www.w3.org/1999/xhtml";
let $sourcedoc := fn:doc("MOST.xhtml") return for $ancora at $gatto in $sourcedoc//*[@class="testo"]
return if (not($ancora/@id)) then insert node attribute id {concat("testo",$gatto)} into $ancora else()
Saxon run the Query and change the original file, “MOST.xhtml”. If I try the same query in XBase on Ubuntu, I see in the log XBase find the tag to add the id, but the original file is not changed. What I’m missing?
Thank you
Fabrizio
basex-talk@mailman.uni-konstanz.de