Changes

Jump to navigation Jump to search
362 bytes added ,  15:15, 1 April 2012
'''Example:'''
Contents of the file {{Mono|hello-worldHelloWorld.xq}}:
<pre class="brush:xquery">
(:~ : This is an example for a module that can be added to the BaseX repository. : @author BaseX Team 2005-12, BSD License :)module namespace m = 'http://basex.org/modules/hello/WorldHello'; (:~ : Say hello to someone. : @param $world the one to be greeted : @return welcome string :)declare function m:hello($world) { 'Hello ' || $world };
</pre>
<pre class="brush:xquery">
import module namespace m = 'http://basex.org/modules/hello/WorldHello';m:hello('"Universe'")
</pre>
META-INF/
MANIFEST.MF
org/basex/modules/hello/ WorldHello.class
Contents of the file {{Mono|MANIFEST.mf}}:
Manifest-Version: 1.0
Main-Class:org.basex.modules.hello.WorldHello
Installation (the file will be copied to {{Mono|org/basex/modules/hello/World.jar}}):
REPO INSTALL HelloWorld.jar
XQuery importing the module (same as above): <pre class="brush:xquery">import module namespace m = 'http://basex.org/modules/Hello';m:hello("Universe")</pre> After installing the module, all of the following URIs can then be used in XQuery to import this module or call its functions:
<nowiki>http://basex.org/modules/hello/World</nowiki>
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu