xml spy
Previous  Top  Next

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 tab 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).

 

xq_text_view

 

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 tab of the Options dialog (Tools | Options).

 

Please note: In the above screenshot, 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).

 


Previous  Top  Next

© 2008 Altova