[MarkLogic Dev General] Stumped on comparing string sequences

Nizamuddin, Rashid rnizamuddin at edmunds.com
Mon May 7 11:47:37 PDT 2007


 

Hi Guys,

 

I have a bit of confusion about collections.

 

As to my understanding, a collection is a bunch of documents. So
basically a document can belong to a collection, some thing like

 

 

Is there a possibility that I can define a filter on which nodes in a
document belong to a collection?

Adding an entire document to a collection is fine, works some thing like
this.

 

xdmp:document-add-collections(

    "/persons.xml", 

    "http://personlist.com")



 

For example I have a document like this

<persons>

<person>

<name>John</name> 

<state>CA</state> 

</person>

<person>

         <name>Jack</name> 

         <state>AZ</state> 

</person>

</persons>

 

Can I say all persons belonging to California should be a part of
http://capersons.com <http://capersons.com/>  collection and if yes how
can I do that

 

I tried some thing like this

xdmp:document-add-collections(

    doc("/persons.xml")//person[state="CA"], 

    "http://capersons.com")

 

And naturally it says document not found. So I inferred that we can add
only documents to a collections and a not a specific nodes of a document
to a collection

 

Any advice.

 

Rashid

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://xqzone.marklogic.com/pipermail/general/attachments/20070507/a16393b0/attachment.html


More information about the General mailing list