[MarkLogic Dev General] Forests and Collections querying problem

Darren Govoni darren at ontrenet.com
Sun Aug 10 09:59:00 PDT 2008


Hi Danny,
  Thanks. Your new query works:

cqsh> xdmp:describe(fn:collection("MDCOL")[1]/node()); 
doc("mde:mdc://5ca78568-3bd5-46f9-bfef-1aa36f3eb3f8")/Metacard

The documentation says collection() can be used anywhere doc() can be
used. But trying this simple xpath query returns nothing.

cqsh> collection("MDCCOL")/Metacard
Done (0.02 sec)
cqsh>

I don't understand completely. I load the XML string into the database.
MarkLogic reports it being loaded. I can run collection("MDCOL"); and
see the documents. Yet every XPath/query I run using the collection
to return a document returns nothing. 

How does one do simple XPath queries against a collection to return
specific documents? I looked at all the use-cases, but none use
collections that I could see. :(

I do appreciate your help. Sorry its time consuming to do this.

Darren


On Sun, 2008-08-10 at 00:47 -0700, Danny Sokolsky wrote:
> xdmp:describe(fn:collection("MDCOL")[1]/node())



More information about the General mailing list