Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using namespace in path range query

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?

like image 590
Ankit Bhardwaj Avatar asked Aug 27 '26 06:08

Ankit Bhardwaj


1 Answers

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

like image 180
paxtonhare Avatar answered Aug 28 '26 20:08

paxtonhare



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!