XQuery Syntax Coloring

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  User Guide and Reference > XQuery > Editing XQuery Documents >

XQuery Syntax Coloring

An XQuery document can consist of XQuery code as well as XML code. The default syntax coloring for the XQuery code is described in this section. The syntax coloring for XML code in an XQuery document is the same as that used for regular XML documents. All syntax coloring (for both XQuery code and XML code) is set in the Text Fonts section of the Options dialog (Tools | Options). Note that XQuery code can be contained in XML elements by enclosing the XQuery code in curly braces {} (see screenshot for example).

Click to expand/collapse

In XQuery code in the XQuery Mode of Text View, the following default syntax coloring is used:


(: Comments, including 'smiley' delimiters, are in green :)
XQuery Keywords are in blue: keyword
XQuery Variables, including the dollar sign, are in purple: $start
XQuery Functions, but not their parentheses, are in olive: function()
Strings are in orange: "Procedure"
All other text, such as path expressions, is black (shown underlined below). So:

for $s in doc("report1.xml")//section[section.title = "Procedure"]

return ($s//incision)[2]/instrument


You can change these default colors and other font properties in the Text Fonts section of the Options dialog (Tools | Options).


Note:In the screenshot above, one pair of colored parentheses for a comment is displayed black and bold. This is because of the bracket-matching feature (see XQuery Intelligent Editing).


© 2019 Altova GmbH