Difference between revisions of "Inspection Module"
Line 3: | Line 3: | ||
=Introduction= | =Introduction= | ||
− | [http://xqdoc.org xqDoc] provides a simple vendor neutral solution for generating documentation from XQuery modules. The documentation conventions have been inspired | + | [http://xqdoc.org xqDoc] provides a simple vendor neutral solution for generating a documentation from XQuery modules. The documentation conventions have been inspired by the JavaDoc standard. Documentation comments begin with {{Code|(:~}} and end with {{Code|:)}}, and tags start with {{Code|@}}. xqDoc comments can be specified for main and library modules, variable declarations and function declarations, as shown in the following example: |
+ | |||
+ | <pre class="brush:xquery"> | ||
+ | (:~ | ||
+ | : This module provides some sample functions. | ||
+ | : | ||
+ | : @author John Clash | ||
+ | : @version 1.0 | ||
+ | :) | ||
+ | module namespace samples = 'http://basex.org/modules/samples'; | ||
+ | |||
+ | (:~ This is a sample number. :) | ||
+ | declare variable $samples:number := 1; | ||
+ | |||
+ | (:~ | ||
+ | : This function simply returns the specified number. | ||
+ | : @param $number number to return | ||
+ | : @return specified number | ||
+ | :) | ||
+ | declare function samples:same($number as xs:integer) as xs:integer { | ||
+ | $number | ||
+ | }; | ||
+ | |||
+ | </pre> | ||
=Conventions= | =Conventions= |
Revision as of 00:11, 31 May 2013
This XQuery Module contains functions for generating xqDoc files from XQuery modules.
Introduction
xqDoc provides a simple vendor neutral solution for generating a documentation from XQuery modules. The documentation conventions have been inspired by the JavaDoc standard. Documentation comments begin with (:~
and end with :)
, and tags start with @
. xqDoc comments can be specified for main and library modules, variable declarations and function declarations, as shown in the following example:
(:~ : This module provides some sample functions. : : @author John Clash : @version 1.0 :) module namespace samples = 'http://basex.org/modules/samples'; (:~ This is a sample number. :) declare variable $samples:number := 1; (:~ : This function simply returns the specified number. : @param $number number to return : @return specified number :) declare function samples:same($number as xs:integer) as xs:integer { $number };
Conventions
All functions in this module are assigned to the http://basex.org/modules/xqdoc
namespace, which is statically bound to the xqdoc
prefix.
All errors are assigned to the http://basex.org/errors
namespace, which is statically bound to the bxerr
prefix.
Functions
xqdoc:parse
Signatures | xqdoc:parse($input as xs:string) as element(xqdoc:xqdoc)
|
Summary | Parses the specified $input and generates an xqDoc element.
|
Changelog
This module was introduced with Version 7.7.