|
From: Kisdi B. <bk...@fr...> - 2013-07-19 16:52:42
|
Hello,
I use eXist-db 2.0 (installed from eXist-db-setup-2.0-rev18252.jar) on Windows XP, with Chrome version 27.0.1453.116.
I have an XML document in the database /*doc("/db/data/mypoints.xml")*/ and I want to run some XQuery on it. The document has a default namespace, the first line is:
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" creator="MapSource 6.16.1" version="1.1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
(It is a set of GPS-coordinates downloaded from the widget, so I MUST use the default namespace.)
I couldn't query from the file without defining the same namespace (the following code returns empty set without the second line):
xquery version "3.0";
declare default element namespace "http://www.topografix.com/GPX/1/1";
doc("/db/data/mypoints.xml")//link
It returns the node as expected.
Now I want to query through REST:
http://localhost:8080/exist/rest/db/data/mypoints.xml?_query=//link
The result is empty again; perhaps for the same reason. How can I define the namespace for the query?
Or, is it a misconfiguration in my server? I can query from /db/apps/demo/data/r_and_j.xml, as the demo examples suggest.
Thanks.
|