BaseX 7.7 error in working with EQNames
Sunday, 11 August 2013 · 3 messages · last reply 11 Sep 2013
DN
Dimitre Novatchev11 Aug 2013 19:47 #
Hi,
Given this XML document (in file example.xml):
<p xmlns="http://example.com/one" xml:lang="de" author="Friedrich von
Schiller">
Freude, schöner Götterfunken,<br/>
Tochter aus Elysium,<br/>
Wir betreten feuertrunken,<br/>
Himmlische, dein Heiligtum.</p>This XQuery expression (in file TesQNametExpression.xquery, in the same directory):
let $doc := doc('example.xml')
return
string-length($doc/Q{
http://example.com/one}p[1]/@Q{http://www.w3.org/XML/1998/namespace}lang)produces:
0
However the correct result (which I get with Saxon 9.5.01) is:
1
Here is the "Query Info" from the BaseX UI:
Compiling:
- pre-evaluating
fn:doc("example.xml")
- binding static variable $doc
- removing unknown element/attribute Q{http://example.com/one}p
- pre-evaluating fn:string-length(())
- removing variable $doc
- simplifying flwor expression
Query:
let $doc := doc('example.xml') return string-length($doc/Q{
http://example.com/one}p[1]/@Q{http://www.w3.org/XML/1998/namespace}lang) Optimized Query:
0
Hope that this information would be useful for identifying and fixing the issue.--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence. ---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.
CG
Christian Grün12 Aug 2013 15:26 #
Dimitre,
thanks for the bug fix, for which I’ve created an entry in our bug tracker [1].
Best,
Christian
[1] https://github.com/BaseXdb/basex/issues/744
___________________________
2013/8/11 Dimitre Novatchev <dnovatchev at gmail.com>:
Quoted text · Dimitre Novatchev · 79 lines
> Hi, > > Given this XML document (in file example.xml): > > <p xmlns="http://example.com/one" xml:lang="de" author="Friedrich von > Schiller"> > Freude, schöner Götterfunken,<br/> > Tochter aus Elysium,<br/> > Wir betreten feuertrunken,<br/> > Himmlische, dein Heiligtum.</p> > > This XQuery expression (in file TesQNametExpression.xquery, in the same > directory): > > let $doc := doc('example.xml') > return > > string-length($doc/Q{http://example.com/one}p[1]/@Q{http://www.w3.org/XML/1998/namespace}lang) > > > produces: > > 0 > > > However the correct result (which I get with Saxon 9.5.01) is: > > 1 > > > Here is the "Query Info" from the BaseX UI: > > Compiling: > - pre-evaluating fn:doc("example.xml") > - binding static variable $doc > - removing unknown element/attribute Q{http://example.com/one}p > - pre-evaluating fn:string-length(()) > - removing variable $doc > - simplifying flwor expression > Query: > let $doc := doc('example.xml') return > string-length($doc/Q{http://example.com/one}p[1]/@Q{http://www.w3.org/XML/1998/namespace}lang) > Optimized Query: > 0 > > Hope that this information would be useful for identifying and fixing the > issue. > > -- > Cheers, > Dimitre Novatchev > --------------------------------------- > Truly great madness cannot be achieved without significant intelligence. > --------------------------------------- > To invent, you need a good imagination and a pile of junk > ------------------------------------- > Never fight an inanimate object > ------------------------------------- > To avoid situations in which you might make mistakes may be the > biggest mistake of all > ------------------------------------ > Quality means doing it right when no one is looking. > ------------------------------------- > You've achieved success in your field when you don't know whether what > you're doing is work or play > ------------------------------------- > Facts do not cease to exist because they are ignored. > ------------------------------------- > Typing monkeys will write all Shakespeare's works in 200yrs.Will they write > all patents, too? :) > ------------------------------------- > I finally figured out the only reason to be alive is to enjoy it. > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
CG
Hi Dimitre,
the bug you encountered has now been fixed [1]; feel free to check out the latest stable snapshot [2] (7.7.1 will be released soon).
Best,
Christian
[1] https://github.com/BaseXdb/basex/issues/744
[2] files.basex.org/releases/latest
___________________________
2013/8/11 Dimitre Novatchev <dnovatchev at gmail.com>:
Quoted text · Dimitre Novatchev · 79 lines
> Hi, > > Given this XML document (in file example.xml): > > <p xmlns="http://example.com/one" xml:lang="de" author="Friedrich von > Schiller"> > Freude, schöner Götterfunken,<br/> > Tochter aus Elysium,<br/> > Wir betreten feuertrunken,<br/> > Himmlische, dein Heiligtum.</p> > > This XQuery expression (in file TesQNametExpression.xquery, in the same > directory): > > let $doc := doc('example.xml') > return > > string-length($doc/Q{http://example.com/one}p[1]/@Q{http://www.w3.org/XML/1998/namespace}lang) > > > produces: > > 0 > > > However the correct result (which I get with Saxon 9.5.01) is: > > 1 > > > Here is the "Query Info" from the BaseX UI: > > Compiling: > - pre-evaluating fn:doc("example.xml") > - binding static variable $doc > - removing unknown element/attribute Q{http://example.com/one}p > - pre-evaluating fn:string-length(()) > - removing variable $doc > - simplifying flwor expression > Query: > let $doc := doc('example.xml') return > string-length($doc/Q{http://example.com/one}p[1]/@Q{http://www.w3.org/XML/1998/namespace}lang) > Optimized Query: > 0 > > Hope that this information would be useful for identifying and fixing the > issue. > > -- > Cheers, > Dimitre Novatchev > --------------------------------------- > Truly great madness cannot be achieved without significant intelligence. > --------------------------------------- > To invent, you need a good imagination and a pile of junk > ------------------------------------- > Never fight an inanimate object > ------------------------------------- > To avoid situations in which you might make mistakes may be the > biggest mistake of all > ------------------------------------ > Quality means doing it right when no one is looking. > ------------------------------------- > You've achieved success in your field when you don't know whether what > you're doing is work or play > ------------------------------------- > Facts do not cease to exist because they are ignored. > ------------------------------------- > Typing monkeys will write all Shakespeare's works in 200yrs.Will they write > all patents, too? :) > ------------------------------------- > I finally figured out the only reason to be alive is to enjoy it. > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
Written for BaseX 7.7. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery