# fn:index-of - XPath XQuery Reference

Returns a sequence of positive integers giving the positions within the sequence
               $seq of items that are equal to $search.deterministiccontext-dependentfocus-independentdeterministiccontext-dependentfocus-independentThe function returns a sequence of positive integers giving the positions within the
            sequence $seq of items that are equal to $search.The collation used by this function is determined according to the rules in . This collation is used when string comparison is
            required.The items in the sequence $seq are compared with $search under
            the rules for the eq operator. Values of type xs:untypedAtomic
            are compared as if they were of type xs:string. Values that cannot be
            compared, because the eq operator is not defined for their types, are
            considered to be distinct. If an item compares equal, then the position of that item in
            the sequence $seq is included in the result.The first item in a sequence is at position 1, not position 0.The result sequence is in ascending numeric order.fn:index-of((10, 20, 30, 40), 35)()fn:index-of((10, 20, 30, 30, 20, 10), 20)(2, 5)fn:index-of(("a", "sport", "and", "a", "pastime"),
                  "a")(1, 4)fn:index-of(current-date(), 23)()fn:index-of([1, [5, 6], [6, 7]], 6)(3, 4)The array is atomized to a sequence of five integersIf @a is an attribute of type xs:NMTOKENS whose string
               value is "red green blue", and whose typed value is therefore
                  ("red", "green", "blue"), then fn:index-of(@a, "blue")
               returns 3. This is because the function calling mechanism atomizes the
               attribute node to produce a sequence of three xs:NMTOKEN values.If the value of $seq is the empty sequence, or if no item in
               $seq matches $search, then the function returns the empty
            sequence.No error occurs if non-comparable values are encountered. So when comparing two atomic
            values, the effective boolean value of fn:index-of($a, $b) is true if
               $a and $b are equal, false if they are not equal or not
            comparable.