Altova XMLSpy 2024 Enterprise Edition

XQuery Syntax Coloring

Home Prev Top Next

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 Fonts and Colors 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 gray :)

XQuery Keywords are in blue: keyword

XQuery Variables, including the dollar sign, are in purple: \$start

XQuery Functions, but not their parentheses, are in green: 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 Fonts and Colors section of the Options dialog (Tools | Options).

 

© 2017-2023 Altova GmbH