Not sure what version you are using but many of the element-xxx-functions 
support min-occurs=n max-occurs=n options.  So you can use the following to 
test out the functionality


xquery version "1.0-ml";
declare namespace html = "http://www.w3.org/1999/xhtml";;
xdmp:document-insert("/test/progs/1.xml",<doc><program>A</program><program>B</program></doc>);
xdmp:document-insert("/test/progs/2.xml",<doc><program>A</program></doc>);
cts:search(xdmp:directory("/test/","infinity"),cts:element-value-query(xs:QName("program"),"*",("wildcarded","max-occurs=1")))


RETURNS
<doc>
<program>A</program>
</doc>

Gary Vidal
Media Consultant
MarkLogic Corporation
[email protected]
Phone: +1 917 576-5794
Skype: ml-garyvidal
www.marklogic.com


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

Reply via email to