Changes

Jump to navigation Jump to search
87 bytes added ,  13:10, 27 April 2012
no edit summary
The Java Binding feature is an extensibility mechanism which enables developers
to directly access Java variables and execute code from XQuery. Java classes are identified by
namespaces; the . The namespace URI must simply contain the fully qualified class name.The URI can optionally be of prefixed with the form string {{Mono|java:fully.qualified.ClassName}}to enforce thatthe addressed code is written in Java.
=Namespace Declarations=
first argument:
<pre class="brush:xquery">declare namespace fw = &quot;java:"java.io.FileWriter&quot;@;
let $file := fw:new('output.txt')
return (
<pre class="brush:xquery">
import module namespace set = "java:java.util.HashSet";
let $loop :=
for $i in 1 to 10000
<pre class="brush:xquery">
import module namespace context = 'java:org.basex.examples.query.ContextModule';
<context>{
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu