Syntax Highlight and Content Completion

To create a new XQuery document select FileNew (Ctrl+N) and when the New Document dialog appears select XQuery entry.

Once you created the new document <oXygen/> provides syntax highlight for keywords and all known XQuery functions and operators. Also for these there is available a content completion component that can be activated by pressing Ctrl+Space keys. The functions and operators are presented together with a comment about parameters and functionality. For some supported database engines like eXist and Berkeley DB, the content completion lists contain the XQuery functions implemented by that engine if the XQuery file has an associated transformation scenario which use one of the specified engine or the XQuery file has no associated scenario but the validation is make with one of these engines (a validation engine is specified in XML / XSLT - FO / XQuery Preferences page). This helps you to insert in your queries only calls to the functions implemented by the target database engine.

The extension functions built in the Saxon product are available on Content Completion if one of the following conditions are true:

If the Saxon namespace (http://saxon.sf.net) is mapped to a prefix this prefix is used when the functions are presented, otherwise the default prefix for the saxon namespace (saxon) is used.

If you want to use a function from a namespace mapped to a prefix, just type that prefix and the Content Completion will display all the XQuery functions from that namespace. The XQuery functions from default namespace offered by content completion are prefixed if the default namespace is mapped to a prefix, otherwise is displayed just the name of this.

The content completion popup window presents all the variables and functions from both the edited XQuery file and its imports.

Figure 11.4. XQuery Content Completion

XQuery Content Completion