Context steps and function expression steps
In general, when you create functional indexes over XML data, for example by using the fn:exists and fn:upper-case functions, the XML pattern expression that you specify in the GENERATE KEYS USING XMLPATTERN clause has two parts.
The first part is called the context step. The context step specifies the XML path of the element nodes or attribute nodes for which index entries will be created. The syntax of the context step follows the same syntax as the index pattern expression for XML indexes in general, but has certain restrictions when used together with specific functions, such as fn:upper-case and fn:exists. See information about using the CREATE INDEX statement for details.
The second part is called the function expression step. The function expression step specifies the function, such as fn:exists or fn:upper-case, and its parameters. The function expression step produces the actual key value to be stored in the index for each node specified by the context step.
- The context step is /a/b
- The function expression step is fn:upper-case(.)
- The context step is /a/b
- The function expression step fn:exists(c)