<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <style type="text/css"><!-- DIV {margin:0px;} --></style>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <br>
    Forwarding an off-list reply to the list. (Mohamed, please don't go
    off-list).<br>
    <br>
    MK<br>
    <br>
    -------- Original Message --------
    <table class="moz-email-headers-table" border="0" cellpadding="0"
      cellspacing="0">
      <tbody>
        <tr>
          <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Subject: </th>
          <td>Re : [xquery-talk] about a query which have a contains
            function</td>
        </tr>
        <tr>
          <th valign="BASELINE" align="RIGHT" nowrap="nowrap">Date: </th>
          <td>Wed, 27 Oct 2010 00:51:47 +0100 (BST)</td>
        </tr>
        <tr>
          <th valign="BASELINE" align="RIGHT" nowrap="nowrap">From: </th>
          <td>Mohamed kharrat <a class="moz-txt-link-rfc2396E" href="mailto:med_khr@yahoo.fr">&lt;med_khr@yahoo.fr&gt;</a></td>
        </tr>
        <tr>
          <th valign="BASELINE" align="RIGHT" nowrap="nowrap">To: </th>
          <td>Michael Kay <a class="moz-txt-link-rfc2396E" href="mailto:mike@saxonica.com">&lt;mike@saxonica.com&gt;</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    <br>
    <style type="text/css"><!-- DIV {margin:0px;} --></style>
    <div style="font-family: arial,helvetica,sans-serif; font-size:
      10pt;">
      <div>well,<br>
        i have this query<br>
        <br>
        let $y:="Java Web Services"<br>
        <br>
        &nbsp;&nbsp;&nbsp; for $x in doc("query/books.xml")<br>
        <br>
        &nbsp;&nbsp;&nbsp; where contains($x/books/book/title/text(),$y)<br>
        <br>
        &nbsp;&nbsp;&nbsp; return $x<br>
        <br>
        it does't return a value, but it return [err:XPTY0004]A sequence
        with more than one item does not match the type text()?
        according to the Sequence Type Matching rules.<br>
        if i write&nbsp;
        <style>.c9Y6TC { color: rgb(0, 0, 255); }</style> &nbsp;&nbsp;&nbsp;&nbsp;<span
          class="c9Y6TC">return</span> $x/books/book/authors/author the
        same thing, it does't work<br>
        it work only if i write&nbsp;&nbsp; return 1&nbsp; , in this case when the
        query find "Java Web Services" it return 1 <br>
        <br>
        thank you<br>
      </div>
      <div style="font-family: arial,helvetica,sans-serif; font-size:
        10pt;"><br>
        <div style="font-family: times new roman,new york,times,serif;
          font-size: 12pt;"><font face="Tahoma" size="2">
            <hr size="1"><b><span style="font-weight: bold;">De :</span></b>
            Michael Kay <a class="moz-txt-link-rfc2396E" href="mailto:mike@saxonica.com">&lt;mike@saxonica.com&gt;</a><br>
            <b><span style="font-weight: bold;">&Agrave; :</span></b>
            <a class="moz-txt-link-abbreviated" href="mailto:talk@x-query.com">talk@x-query.com</a><br>
            <b><span style="font-weight: bold;">Envoy&eacute; le :</span></b>
            Mar 26 octobre 2010, 23h 29min 26s<br>
            <b><span style="font-weight: bold;">Objet&nbsp;:</span></b> Re:
            [xquery-talk] about contains function<br>
          </font><br>
          On 26/10/2010 21:30, Mohamed kharrat wrote:
          <blockquote type="cite">
            <div style="font-family: arial,helvetica,sans-serif;
              font-size: 10pt; color: rgb(0, 0, 0);">
              <div>Dear sir,<br>
                i need to use contains function with&nbsp; NUX JAVA API<br>
                second question<br>
                i need to query a collection.<br>
                <br>
                how to do that.<br>
                <br>
                thank you<br>
              </div>
            </div>
            <br>
            <pre><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
<a moz-do-not-send="true" rel="nofollow" class="moz-txt-link-abbreviated" ymailto="mailto:talk@x-query.com" target="_blank" href="mailto:talk@x-query.com">talk@x-query.com</a>
<a moz-do-not-send="true" rel="nofollow" class="moz-txt-link-freetext" target="_blank" href="http://x-query.com/mailman/listinfo/talk">http://x-query.com/mailman/listinfo/talk</a></pre>
          </blockquote>
          It would be useful to know how far you have got, and where you
          got stuck.<br>
          <br>
          Are you able to run queries at all - or is it this specific
          query you are having difficulty with?<br>
          <br>
          Is your problem with the query, or with the Java API?<br>
          <br>
          What did you try, and how did it fail?<br>
          <br>
          We need to know the answers to these questions so we can try
          to explain what to do in terms you are likely to understand.<br>
          <br>
          When people have problems with the contains function it is
          often because they tried to guess what it did instead of
          reading the specification; the behaviour of a function can
          sometimes be guessed from its name, but not always.<br>
          <br>
          Michael Kay<br>
          Saxonica<br>
        </div>
      </div>
    </div>
    <br>
    <br>
  </body>
</html>