XQuery/Naming Conventions

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

[edit] Guidelines for wikibook authors

Our goal is to allow many people to contribute examples but allow our readers a consistent user experience. In that light we would like all of our authors to use some of the following standards.

Make sure you use the source tags to surround your code. If it is XML code use the lang="xml" attribute.

<source lang="xml">
...xml code here...
</source>

Try to keep the examples as simple as you can to demonstrate the core concepts of your examples.

[edit] Sample XQuery File

xquery version "1.0";
let $message := 'Hello World!'
return
<results>
   <message>{$message}</message>
</results>

Each XQuery file should begin with the word xquery and the version number.

xquery version "1.0";

Complex XQueries should have comments using the XQuery comments

xquery version "1.0";
 
(: This is a comment :)