Words that are specified for use in XQuery functions (for, if, etc.) are called keywords. Keywords in XQuery are specified in all lower case. XQuery distinguishes between upper-case and lower-case letters.
The following characters or elements can serve as separators in XQuery:
- Space (X'20')
- TAB (X'09')
- NL (X'0a')
- CR (X'0d')
- XQuery comment
(a) Where separators must be inserted
Separators must be inserted in the following places:
- Between two keywords
- Between a keyword and a qualified name
- Between a keyword and a numeric literal
- After a qualified name and before the subtraction operator (-)
(b) Where separators cannot be inserted
Separators cannot be inserted in the following places:
- Inside a keyword
- Inside a qualified name
- Inside a numeric literal
- Inside a character string literal
- Inside an operator
- Inside an XQuery path expression specified within //
- Inside an XQuery path expression specified within ..
- Inside an XQuery path expression specified within ::
- In an XQuery variable reference between the $ and the XQuery variable name
- In an XQuery comment between ( and :
- In an XQuery comment between : and )
- Inside a FLWOR expression specified within :=
(c) Where separators may be inserted
Separators may be inserted in the following places:
- In places not prohibited under Where separators cannot be inserted above, as well as before and after the following special characters:
, . - + * ' " ( ) < > = ! / : ; | [ ] space (X'20'), TAB (X'09'), NL (X'0a'), and CR (X'0d')