A query can define a variable in the prolog. Such a variable is available at any point after it is declared. For instance, if access to the titles of books is used several times in a query, it can be provided in a variable definition:
define variable $titles { doc("books.xml")//title }
To avoid circular references, a variable definition may not call functions that are defined prior to the variable definition.
18.191.135.224