well, the XQuery might be the same, but because you certainly use different 
BaseX instances they might use different properties (i.e. point to a different 
BaseX storage). At least for the examples you provide here it simply doesn't 
add up. To make it clear: You say the result on the right is with the old BaseX 
version. One of the results is the string 
http://localhost:8080/def/crs/OGC/0/_Temporal_template. However, the string 
does simply not appear in your input XML. So, where does the difference come 

Maybe it would be easier to simply forget about the old version and instead you 
could describe what results you are missing from the 8.6.7 vcersion? (you said 
data is missing)? I can hardly imagine that something is really missing in this 

However, what certainly has improved (and thus: changed) with BaseX 8 (I think) 
is the serialization. It uses the adaptive serialization by default, which uses 
newlines as separators when serialiazing. However, you can switch to any other 
serialization method quite easily and use the old default xml by issueing 
"declare option output:method "xml"; in the query prolog.


Von: Bang Pham Huu [mailto:b.pham...@jacobs-university.de]
Gesendet: Freitag, 2. Februar 2018 10:08
An: Kirsten, Dirk <dirk.kirs...@senacor.com>; basex-talk@mailman.uni-konstanz.de
Betreff: Re: AW: [basex-talk] Big Surprise from outputs in version 7.3.1 and 
8.6.7 ?

Yes, I'm sure I tested with old database from version 7.3.1 for both versions 
(7.3.1 and 8.6.7). Please see the exported XML from this database here: 

with this XQuery: db:export("userdb", "./userdb", map { 'method': 'xml' })

At least I can see that query in version 7.3.1 doesn't return "new line 
character \n" as in 8.6.7 but an empty space " ".


On 02/02/2018 09:46 AM, Kirsten, Dirk wrote:

are you sure you are querying the same collection? I am quite confused by your 
different outputs, because they seem to have not much in common (the results on 
the left almost exclusively return URIs pointing to opengis.net and the one on 
the right to localhost:8080?

If you are sure it would most certainly be helpful if you provide the input XML.

Also, looking at your query I don't really get why you write it that way, e.g. 
"for $i in $x return $i" is identical as simply "$x"...


Senacor Technologies Aktiengesellschaft - Sitz: Eschborn - Amtsgericht 
Frankfurt am Main - Reg.-Nr.: HRB 105546
Vorstand: Matthias Tomann, Marcus Purzer - Aufsichtsratsvorsitzender: Daniel 
-----Ursprüngliche Nachricht-----
 [mailto:basex-talk-boun...@mailman.uni-konstanz.de] Im Auftrag von Bang Pham 
Gesendet: Freitag, 2. Februar 2018 08:45
Betreff: [basex-talk] Big Surprise from outputs in version 7.3.1 and 8.6.7 ?


I've been using BaseX to query an XML file in version 7.3.1 and it worked well. 
However, because of this problem 
and I was suggested to use version 8.6.7 then I changed to use this version in 
a Java Web application which queries the old BaseX files from version 7.3.1.

However, I didn't know that this version changes created a very surprise result 
between version 7.3.1 and 8.6.7 (i.e: data is missing in version
8.6.7 from output result !!!).

Could someone tell me why it happens and how to use BaseX version 8.6.7 on 
BaseX database from version 7.3.1.

Here is the difference between 2 outputs on same old BaseX database version 
7.3.1 (left: 8.6.7, right: 7.3.1) with same XQuery:

The XQuery is:

 declare namespace gml = "http://www.opengis.net/gml/3.2";;
 declare function local:get-children() {
 let $x := collection('userdb')//gml:identifier/text()
      if (exists($x)) then
           for $i in $x
                return $i
      else <empty/>

  let $x := distinct-values(local:get-children())
  for $i in $x return $i


Reply via email to