You cannot specify attributes as the first argument to cts:search.  You need to 
specify an attribute as the second argument as a cts:query, and you must 
specify each one separately.  Something like:

xquery version "1.0-ml";
let $word := "C28161"
return
cts:search(doc(),  cts:element-attribute-word-query((xs:QName("my-element1"),
                xs:QName("my-element2"), xs:QName("my-element3")),
                xs:QName("myattribute"), $word) )

Each QName in cts:element-attribute-word-query can be a sequence of QNames, and 
the result is the union of all of the combinations of elements and attributes.


-Danny

From: [email protected] 
[mailto:[email protected]] On Behalf Of Lee, David
Sent: Thursday, December 10, 2009 10:54 AM
To: [email protected]
Subject: [MarkLogic Dev General] Searching attribute values with unknown 
element/attribute names

Whats the right cts:search* query to do a word search in attribute values like 
cts:word-query() but for attributes.
I cant find one !!

I tried this

cts:search( //@* , "C28161"  )
cts:search( doc()//@* , "C28161"  )

but no go ... (not searchable).

cts:search(
cts:element-attribute-word-query( () , () , "C28161" ) )

but no go ...




Any suggestions ?



----------------------------------------
David A. Lee
Senior Principal Software Engineer
Epocrates, Inc.
[email protected]<mailto:[email protected]>
812-482-5224


_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to