BaseX Gui import (Add) doesn't replace items

Tuesday, 20 August 2013 · 2 messages · last reply 21 Aug 2013
DK
Dirk Kirstenin reply to France Baril, 21 Aug 2013, 00:1320 Aug 2013 22:26 #
Hello France, documents in BaseX can be added multiple times with the same path. You can take a look at the previous discussion here and for some explanation why it behaves like it does today: https://github.com/BaseXdb/basex/issues/429 If you want to replace a resource the simplest thing to do would be to use the db:replace function, see http://docs.basex.org/wiki/Database_Module#db:replace Cheers, Dirk
Quoted text · France Baril · 45 lines
On 08/20/2013 10:13 PM, France Baril wrote: > Hi, > > Context: DB name A > Collection B > File C.xml with <p id="i1">Hello</p> > > In BaseX Gui, DB A is opened. > In the Properties window, browse to the file C.xml, say you want to add in > under B and click Add. > Repeat the operation (to replace C.xml, with a new update C.xml) > > In BaseX Gui, try: > for $x in /*[@id='i1'] > return $x > > You'll get this: > <p id="i1">Hello</p> > <p id="i1">Hello</p> > > If you try this: > for $x in /*[@id='i1'] > return $x/base-uri() > > You'll get > A/B/C.xml > A/B/C.xml > > Applying db:optimize won't change anything. > > Basically, it looks like the content of the file is appended to the > existing file. Expectation is that it should replace it. > > Side effect: When we open the file in XML Oxygen through WebDAV, the file > appears to be empty. > > > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
-- Dirk Kirsten, BaseX GmbH, http://basex.org |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22
FB
France Baril21 Aug 2013 00:13 #
Hi, Context: DB name A Collection B File C.xml with <p id="i1">Hello</p> In BaseX Gui, DB A is opened. In the Properties window, browse to the file C.xml, say you want to add in under B and click Add. Repeat the operation (to replace C.xml, with a new update C.xml) In BaseX Gui, try:
for $x in /*[@id='i1']
return $x
You'll get this:
<p id="i1">Hello</p>
<p id="i1">Hello</p>
If you try this:
for $x in /*[@id='i1']
return $x/base-uri()
You'll get A/B/C.xml A/B/C.xml Applying db:optimize won't change anything. Basically, it looks like the content of the file is appended to the existing file. Expectation is that it should replace it. Side effect: When we open the file in XML Oxygen through WebDAV, the file appears to be empty.
-- France Baril Architecte documentaire / Documentation architect france.baril at architextus.com (514) 572-0341

⚡Generated with XQuery