[MarkLogic Dev General] Stumped on comparing string sequences

Jason Hunter jhunter at marklogic.com
Sun May 13 00:26:47 PDT 2007


Hi Rashid,

I don't think you received a response, so let me jump in.

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

Correct.

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

Membership in a collection is at the document level, not the node level.

> <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

You can do this without using collections.  For example:

/persons/person[state = "CA"][name = "John"]

Have you tried this?  How many person elements are you querying against 
in each file?

-jh-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4506 bytes
Desc: S/MIME Cryptographic Signature
Url : http://xqzone.marklogic.com/pipermail/general/attachments/20070513/28678bbc/smime.bin


More information about the General mailing list