expath-pkg.xml
functx/
functx.xql functx.xsl
</pre>
<pre class="brush:xml">
<package xmlns="http://expath.org/ns/pkg">
<jar>...</jar>
....
<class>...</class> <class>...</class>
....
</package>
</pre>
public final class Printer {
public String print(final String s) { return new Writer(s).write(); }
}
</pre>
declare function j:print($str as xs:string) as xs:string {
let $printer := p:new() return p:print($printer, $str)
};
</pre>
As it can be seen , the class <code>{{Mono|Printer</code> }} is declared with its binary name as a namespace prefixed with "java" and the XQuery function is implemented using the [http://docs.basex.org/wiki/Java_Bindings Java Bindings] offered by BaseX.
[http://files.basex.org/xar/ Here] you can find the FunctX library packaged as a .xar and a sample package containing a .jar file. You can use them to try our packaging API or just as a reference if you want to create your own packages.