Changes

Jump to navigation Jump to search
1,534 bytes added ,  00:14, 31 May 2013
no edit summary
=Introduction=
[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 [[Example|example]] below. =Conventions= All functions in this module are assigned to the {{Code|http://basex.org/modules/xqdoc}} namespace, which is statically bound to the {{Code|xqdoc}} prefix.<br/>All errors are assigned to the {{Code|http://basex.org/errors}} namespace, which is statically bound to the {{Code|bxerr}} prefix. =Functions= ==xqdoc:parse=={| width='100%'|-| width='90' | '''Signatures'''|{{Func|xqdoc:parse|$input as xs:string|element(xqdoc:xqdoc)}}|-| '''Summary'''|Parses the specified {{Code|$input}} and generates an xqDoc element.|} =Example= The following example:module...
<pre class="brush:xquery">
$number
};
 
</pre>
=Conventions=...will be converted to the following xqDoc file:
All functions in this module are assigned to the {{Code|<pre class="brush:xml"><xqdoc:xqdoc xmlns:xqdoc="http://basexwww.xqdoc.org/modules1.0"> <xqdoc:control> <xqdoc:date>2013-05-31T00:13:02.199+02:00</xqdoc}} namespace, which is statically bound to the {{Code|:date> <xqdoc}} prefix:version>1.1<br/xqdoc:version>All errors are assigned to the {{Code| </xqdoc:control> <xqdoc:module type="library"> <xqdoc:uri>http://basex.org/errors}} namespace, which modules/samples</xqdoc:uri> <xqdoc:name>sample.xq</xqdoc:name> </xqdoc:module> <xqdoc:imports/> <xqdoc:variables> <xqdoc:variable> <xqdoc:name>samples:number</xqdoc:name> <xqdoc:comment> <xqdoc:description>This is statically bound to the {{Code|bxerr}} prefixa sample number.</xqdoc:description> </xqdoc:comment> </xqdoc:variable> </xqdoc:variables> <xqdoc:functions> <xqdoc:function arity=Functions="1"> <xqdoc:comment>== <xqdoc:description>This function simply returns the specified number.</xqdoc:description> <xqdoc:param>$number number to return</xqdoc:parse==param>{| width='100%' <xqdoc:return>specified number</xqdoc:return>|- </xqdoc:comment>| width='90' | '''Signatures''' <xqdoc:name>samples:same</xqdoc:name>|{{Func| <xqdoc:parse|signature>declare function samples:same($input number as xs:integer) as xs:string|element(integer</xqdoc:signature> <xqdoc:parameters> <xqdoc:parameter> <xqdoc:name>number</xqdoc:name> <xqdoc:type>xs:integer</xqdoc:type> </xqdoc:parameter> </xqdoc:parameters> <xqdoc:return> <xqdoc:type>xs:integer</xqdoc:type> </xqdoc)}}:return>|- </xqdoc:function>| '''Summary''' </xqdoc:functions>|Parses the specified {{Code|$input}} and generates an xqDoc element.</xqdoc:xqdoc>|}</pre>
=Changelog=
Bureaucrats, editor, reviewer, Administrators
12,951

edits

Navigation menu