<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="extensions" page="functions" subpage="find"/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: saxon:find()</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: saxon:find()"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>saxon:find()</h1>
      <p><b>saxon:find($indexed-sequence as jt:com.saxonica.expr.IndexedSequence) ==&gt; item()*</b></p>
      <p><b>saxon:find($indexed-sequence as jt:com.saxonica.expr.IndexedSequence, $key-values as xs:anyAtomicType*) ==&gt; item()*</b></p>
      <p>The first argument must be an indexed sequence created using the function 
<a class="bodylink" href="../../extensions/functions/index.xml">saxon:index()</a>. This will invariably
be provided in the form of a variable reference. The type of this object is 
<code>{http://saxon.sf.net/java-type}com.saxonica.expr.IndexedSequence</code></p>
      <p>If the second argument is omitted, the function returns the entire indexed sequence, that is, the
value passed to the first argument of <code>saxon:index()</code>.</p>
      <p>Otherwise, the second argument is a sequence
of atomic values. The result of the function consists of all items in the indexed sequence that match
one or more of these atomic values. Duplicates are not removed. The order of the result is sorted first by the
position of the key value within the sequence of key values, and then by the order of the result items within
the indexed sequence.</p>
      <p>If a key value is of type <code>xs:untypedAtomic</code>, it is treated as a string. Values are matched
according to the rules of the <code>eq</code> operator. This means, for example, that if the indexed values
are numbers, then the key value must be supplied as a number. Supplying a value of a non-comparable type results
in a type error.</p>
      <p>For examples of use, see <a class="bodylink" href="../../extensions/functions/index.xml">saxon:index()</a>.</p>
      <p><i>The <code>saxon:find</code> function is available only with Saxon-PE and Saxon-EE.</i></p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="for-each-group.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>