Antony
Antony

Reputation: 976

Need URI list in marklogic database using Xquery

After executing the below xquery, resulted in whole content from XML but my objective is to get the list of URI.

let $i := cts:search(//root,
    cts:element-value-query(
        xs:QName("no"),
        "123")) 

return ($i)

Upvotes: 1

Views: 66

Answers (1)

Tyler Replogle
Tyler Replogle

Reputation: 1339

If all you want is the URI, use cts:uris(). The 3rd parameter lets you define a query that will filter the URIs list.

So with your example this would work:

cts:uris(
  (), 
  (), 
  cts:element-value-query(
          xs:QName("no"),
          "123")
)

Upvotes: 3

Related Questions