[MonetDB-users] Weird behaviour with namespaces in XQuery
Hello:
I'm using MonetDB for a project. I've observed some weird results when doing a XQuery on an inserted document.
Steps to reproduce the bug are:
xquery>pf:add-doc ('file://var/tmp/pres-rules.xml', 'pres-rules.xml', 'pres-rules', 1) more>xquery>declare namespace xs="http://www.w3.org/2001/XMLSchema"; more>declare namespace cr="urn:ietf:params:xml:ns:common-policy"; more>declare namespace pr="urn:ietf:params:xml:ns:pres-rules"; more>count (doc('pres-rules.xml')/cr:ruleset/cr:rule[@id="pres_whitelist"]/cr:conditions/cr:identity) more><?xml version="1.0" encoding="utf-8"?> <XQueryResult>0</XQueryResult>
However, sometimes, if I restart the Mserver, the same query returns:
more>xquery>declare namespace xs="http://www.w3.org/2001/XMLSchema"; more>declare namespace cr="urn:ietf:params:xml:ns:common-policy"; more>declare namespace pr="urn:ietf:params:xml:ns:pres-rules"; more>count (doc('pres-rules.xml')/cr:ruleset/cr:rule[@id="pres_whitelist"]/cr:conditions/cr:identity) more><?xml version="1.0" encoding="utf-8"?> <XQueryResult>1</XQueryResult>
What is the expected result. I'm sure it's related with namespaces after some tests.
Are you aware of this behaviour? There exists some workaround?
Document to test is attached.
I'm using latest version of MonetDB with XQuery support:
# MonetDB Server v4.34.4 # based on GDK v1.34.4 # Copyright (c) 1993-July 2008, CWI. All rights reserved. # Copyright (c) August 2008-2009, MonetDB B.V.. All rights reserved. # Compiled for x86_64-redhat-linux-gnu/64bit with 64bit OIDs; dynamically linked. # Detected 0.979 GiB (1051709440 bytes) main-memory. # Visit http://monetdb.cwi.nl/ for further information. # PF/Tijah module v0.13.0 loaded. http://dbappl.cs.utwente.nl/pftijah # MonetDB/XQuery module v0.34.4 loaded (default back-end is 'algebra') # XRPC administrative console at http://127.0.0.1:50001/admin
Cheers, Nacho.
participants (1)
-
Ignacio Martín Oya