fn:id

Return sequence of element nodes referenced by IDREF values.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

fn:id(xs:string* $arg, node() $node) => element()*

Description

This function returns a sequence, in document order with duplicates eliminated, of those elements that are in the same document as $node that have an ID value matching one or more of the xs:IDREFs in the list of candidate xs:IDREFs. The list of xs:IDREFs results from parsing the string argument: the string is treated as a sequence of tokens separated by space, and each of the tokens is considered a value of type xs:IDREF. If the token is not a lexically valid xs:IDREF value, it is ignored. If no xs:IDREF value matches the ID value of any element, the function returns the empty sequence. The match is performed strictly using Unicode codepoints, that is, without a collation.

Argument

$arg

string that can be tokenized into valid values of type xs:IDREF

$node

a node