I have an eXist-db with a collection of XML documents. All documents have a namespace in the top node which looks like this
<TEI xmlns="http://www.tei-c.org/ns/1.0" version="5.0" xml:id="No-MM_N0001-01">
When I try to query the documents for information in //div/p from the REST API I get an empty response:
Request:
/data?_query=%2F%2Fdiv%2Fp
Response:
<exist:result xmlns:exist="http://exist.sourceforge.net/NS/exist" exist:hits="0" exist:start="1" exist:count="0" exist:compilation-time="3" exist:execution-time="3"/>
But when I edit one of the documents, removing the xmlns, I get data from the document that I have edited.
Request:
/data?_query=%2F%2Fdiv%2Fp
Response:
<exist:result xmlns:exist="http://exist.sourceforge.net/NS/exist" exist:hits="2" exist:start="1" exist:count="2" exist:compilation-time="1" exist:execution-time="1">
<p>
Jeg fik ikke sove –
<del rend="overstrike">j</del>
så den
<lb/>
lille striben mellem ridauerne lysne
<lb/>
mere og mere –
<del rend="overwritten">v</del>
jeg vendte mig hed
<lb/>
i sengen – Det var
<del rend="overstrike">jo</del>
så tydeli –
So, the question is, how can I query the XML documents in my collection without editing out the namespace in all of them?