Hi All,

I have wrote the query to get all the Subject starting from "P" where
subject, type attribute is "Primary".i.e only that subject node whose value
starts with "P"

cts:search(/a[//Subject/@Type="Primary"],cts:and-query((cts:element-query(fn:expanded-QName("",
"Subject"),"p*"),cts:element-attribute-word-query(fn:expanded-QName("",
"Subject"), fn:expanded-QName("", "Type"), "Primary",
("unstemmed")))))//Subject

but it is returning all the two document.Ideally it should not return me any
document.

<a>
<Subject Type="Primary">Genetics and Genomics</Subject>
<Subject Priority="1" Type="Secondary">Public Health and
Epidemiology</Subject>
</a>
-------

<a>
<Subject Type="Primary">Botany</Subject>
<Subject Priority="1" Type="Secondary">Evolution</Subject>
<Subject Priority="2" Type="Secondary">Genetics/Genomics/Gene
Therapy</Subject>
<Subject Priority="3" Type="Secondary">Plant Science</Subject>
</a>

Please suggest how to achive that?
Thanks in advance.
Mihir
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to