gnu.xquery.lang
public class XQuery extends Language
Field Summary | |
---|---|
static Namespace[] | defaultFunctionNamespacePath |
static String | DEFAULT_ELEMENT_PREFIX Pseudo-namespace "prefix" for the default element namespace. |
static String | DEFAULT_FUNCTION_PREFIX Pseudo-namespace "prefix" for the default function namespace. |
static Environment | extensionsEnvEnv Environment of pre-defined non-standard Qexo/Kawa functions. |
static QuoteExp | falseExp |
static ConstantFunction0 | falseFunction |
static XQuery | instance |
static Namespace | kawaFunctionNamespace |
static String | KAWA_FUNCTION_NAMESPACE |
static String | LOCAL_NAMESPACE |
static int | PARSE_WITH_FOCUS Special parser flag used by evalToFocusProc . |
static Namespace | qexoFunctionNamespace |
static String | QEXO_FUNCTION_NAMESPACE |
static String | SCHEMA_INSTANCE_NAMESPACE |
static String | SCHEMA_NAMESPACE |
static QuoteExp | trueExp |
static ConstantFunction0 | trueFunction |
static int | VARIADIC_FUNCTION_NAMESPACE |
static Environment | xqEnvironment |
static Namespace | xqueryFunctionNamespace |
static String | XHTML_NAMESPACE |
static String | XQUERY_FUNCTION_NAMESPACE |
Constructor Summary | |
---|---|
XQuery() |
Method Summary | |
---|---|
void | applyWithFocus(Procedure proc, Object item, int position, int size, Consumer out) Call a procedure with a given focus (context). |
Object | applyWithFocus(Procedure proc, Object item, int position, int size) Call a procedure with a given focus (context). |
void | applyWithFocus(Procedure proc, Object values, Consumer out) Call a procedure with each item in a sequence as the context item. |
Object | applyWithFocus(Procedure proc, Object values) Call a procedure with each item in a sequence as the context item. |
void | applyWithFocus$X(Procedure proc, Object values, CallContext ctx) Call a procedure with each item in a sequence as the context item. |
static char | asChar(Object x) |
static Numeric | asNumber(Object arg) |
void | define(String name, Object value) |
protected void | define_method(String name, String cname, String mname) |
Procedure | evalToFocusProc(String expr) Parse an XQuery expression that is the body of a procedure.
|
Procedure | evalToFocusProc(Reader in, SourceMessages messages) Parse an XQuery expression from a Reader that is the body of a procedure.
|
void | evalWithFocus(Reader in, SourceMessages messages, Object values, Consumer out) Evaluate an expression with each item in a sequence as the context item. |
Object | evalWithFocus(String expr, Object values) Evaluate an expression with each item in a sequence as the context item. |
Object | evalWithFocus(String expr, Object item, int position, int size) Evaluate an expression with a given focus (context). |
void | evalWithFocus(Reader in, SourceMessages messages, Object item, int position, int size, Consumer out) Evaluate an expression with a given focus (context). |
void | eval_with_focus$X(String expr, Object values, CallContext ctx) Evaluate an expression with a given focus (context).
|
void | eval_with_focus$X(String expr, Object item, int position, int size, CallContext ctx) Evaluate an expression with a given focus (context).
|
String | formatType(Type type) |
Compilation | getCompilation(Lexer lexer, SourceMessages messages) |
static Object | getExternal(Symbol name, Object type) |
static XQuery | getInstance() |
Lexer | getLexer(InPort inp, SourceMessages messages) |
String | getName() |
int | getNamespaceOf(Declaration decl) |
Consumer | getOutputConsumer(Writer out) |
Procedure | getPrompter() |
static Type | getStandardType(String name) |
Symbol | getSymbol(String name) |
Type | getTypeFor(String name) |
Type | getTypeFor(Class clas) |
boolean | hasNamespace(Declaration decl, int namespace) |
boolean | hasSeparateFunctionNamespace() |
boolean | isTrue(Object value) |
static String | makeClassName(String source) |
static String | mangle(String name) |
static int | namespaceForFunctions(int argCount) |
boolean | parse(Compilation tr, int options) |
static void | registerEnvironment() The compiler insert calls to this method for applications and applets. |
void | resolve(Compilation comp) |
evalToFocusProc
.Parameters: proc a 3-operand Procedure
as returned by
evalToFocusProc
item the context item, passed as the first argument to proc
position the context position, passed as the second argument size the context size, passed as the second argument out where to send the result of proc
Parameters: proc a 3-operand Procedure
as returned by
evalToFocusProc
item the context item, passed as the first argument to proc
position the context position, passed as the second argument size the context size, passed as the second argument
Returns: the result of applying proc
Parameters: proc a 3-operand Procedure
as returned by
evalToFocusProc
values a sequence. The proc
is called once for each
item, with the item as the first argument, a 1-based index as the
second argument, and the sequence size as the third argument. out where to send the result of proc
Parameters: proc a 3-operand Procedure
as returned by
evalToFocusProc
values a sequence. The proc
is called once for each
item, with the item as the first argument, a 1-based index as the
second argument, and the sequence size as the third argument.
Returns: the result of applying proc
Parameters: proc a 3-operand Procedure
as returned by
evalToFocusProc
values a sequence. The proc
is called once for each
item, with the item as the first argument, a 1-based index as the
second argument, and the sequence size as the third argument. ctx the CallContext
. The $X
in the
method name tells Kawa that this argument is implicit when invoked
from XQuery.
evalWithFocus
methods.Parameters: expr an XQuery expression (query) to evaluate
Returns: a 3-operand Procedure whose arguments become the context item, position, and size.
Reader
that is the body of a procedure.
Helper method used by evalWithFocus
methods.Parameters: in where we read the expression from messages where to write syntax errors
Returns: a 3-operand Procedure whose arguments become the context item, position, and size.
Parameters: in where we read the expression from messages where to write syntax errors values becomes the context sequence while
evaluating expr
. out where to send the result of the expression
Parameters: expr an XQuery expression (query) to evaluate values becomes the context sequence while evaluating the expression
Returns: the result of evaluating the expression
Parameters: expr an XQuery expression (query) to evaluate item becomes the context item while evaluating expr
. position becomes the context position size becomes the context size
Returns: the result of evaluating expr
Parameters: in where we read the expression from messages where to write syntax errors item becomes the context item while evaluating the expression position becomes the context position size becomes the context size out where to send the result of the expression
evalWithFocus(String, Object, Consumer)
.
The "$X" in the method name tells the Kawa compiler that the CallContext
argument is implicit, so it can be invoked from XQuery code thus:
XQuery:eval-with-focus($xquery, "expr", $sequence)
evalWithFocus(String, Object, int, int, Consumer)
.
The "$X" in the method name tells the Kawa compiler that the CallContext
argument is implicit, so it can be invoked from XQuery code thus:
XQuery:eval-with-focus($xquery, "expr", $item, $pos, $size)