3

I am using cts.pathRangeQuery on an xml document like -

<container xmlns:c="http://example.com/ns/core" xmlns:d="http://example.com/ns/data" xmlns="http://example.com/ns/core">
  <c:domain>
    <d:id>http://example.com/xyz/no-data</d:id>
  </c:domain>
</container>

I want to use a path range query on /c:domain/d:id, something like this -

cts.pathRangeQuery("/c:domain/d:id", "=", "some-id");

But I don't know how to take care of the XML namespaces in this case. Any suggestions on how to do this in JavaScript?

Ankit Bhardwaj
  • 754
  • 8
  • 27

1 Answers1

4

You will want to define your namespaces on the Http Server. See http://docs.marklogic.com/guide/admin/namespaces for more details.

Defining namespaces on an Http Server

paxtonhare
  • 336
  • 1
  • 4
  • Some functions (like [xpath](http://docs.marklogic.com/Document.xpath)) allow you specify bindings, but cts.pathRangeIndex isn't one. There is also a [string representation for QNames](http://docs.marklogic.com/xdmp.keyFromQName), but it looks like that's just for map keys. – Dave Cassel Oct 20 '16 at 15:22
  • 1
    You can manage the namespaces using the [Configuration portion of the Management API](http://docs.marklogic.com/REST/client/configuration). – Dave Cassel Oct 20 '16 at 15:23