|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XQueryService
Field Summary | |
---|---|
static java.lang.String |
SERVICE_NAME
|
Method Summary | |
---|---|
void |
clearNamespaces()
|
CompiledExpression |
compile(java.lang.String query)
Compiles the specified XQuery and returns a handle to the compiled code, which can then be passed to execute(org.xmldb.api.base.CompiledExpression) . |
void |
declareVariable(java.lang.String qname,
java.lang.Object initialValue)
Declare a global, external XQuery variable and assign a value to it. |
ResourceSet |
execute(CompiledExpression expression)
Execute a compiled XQuery. |
java.lang.String |
getNamespace(java.lang.String prefix)
Returns the URI string associated with prefix from
the internal namespace map. |
void |
importModuleNamespace(java.lang.String ncname,
java.lang.String namespaceURI)
Declare a namespace from Java to be imported within the XQuery expression. |
ResourceSet |
query(java.lang.String query)
|
ResourceSet |
queryResource(java.lang.String id,
java.lang.String query)
|
void |
removeNamespace(java.lang.String prefix)
Removes the namespace mapping associated with prefix from
the internal namespace map. |
void |
setModuleLoadPath(java.lang.String path)
|
void |
setNamespace(java.lang.String prefix,
java.lang.String uri)
Sets a namespace mapping in the internal namespace map used to evaluate queries. |
void |
setXPathCompatibility(boolean backwardsCompatible)
Enable or disable XPath 1.0 compatibility mode. |
Methods inherited from interface org.xmldb.api.base.Service |
---|
getName, getVersion, setCollection |
Methods inherited from interface org.xmldb.api.base.Configurable |
---|
getProperty, setProperty |
Field Detail |
---|
static final java.lang.String SERVICE_NAME
Method Detail |
---|
void setNamespace(java.lang.String prefix, java.lang.String uri) throws XMLDBException
prefix
is null or empty the default namespace is
associated with the provided URI. A null or empty uri
results
in an exception being thrown.
prefix
- The prefix to set in the map. If
prefix
is empty or null the
default namespace will be associated with the provided URI.uri
- The URI for the namespace to be associated with prefix.
XMLDBException
java.lang.String getNamespace(java.lang.String prefix) throws XMLDBException
prefix
from
the internal namespace map. If prefix
is null or empty the
URI for the default namespace will be returned. If a mapping for the
prefix
can not be found null is returned.
prefix
- The prefix to retrieve from the namespace map.
prefix
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.void removeNamespace(java.lang.String prefix) throws XMLDBException
prefix
from
the internal namespace map. If prefix
is null or empty the
mapping for the default namespace will be removed.
prefix
- The prefix to remove from the namespace map. If
prefix
is null or empty the mapping for the default
namespace will be removed.
XMLDBException
- with expected error codes.ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.void clearNamespaces() throws XMLDBException
XMLDBException
ResourceSet query(java.lang.String query) throws XMLDBException
XMLDBException
ResourceSet queryResource(java.lang.String id, java.lang.String query) throws XMLDBException
XMLDBException
CompiledExpression compile(java.lang.String query) throws XMLDBException
execute(org.xmldb.api.base.CompiledExpression)
.
XMLDBException
ResourceSet execute(CompiledExpression expression) throws XMLDBException
XQueryService
to the compiled XQuery code.
XMLDBException
void declareVariable(java.lang.String qname, java.lang.Object initialValue) throws XMLDBException
declare variable
statement in the XQuery prolog.
The variable can be referenced inside the XQuery expression as
$variable
. For example, if you declare a variable with
declareVariable("name", "HAMLET");you may use the variable in an XQuery expression as follows:
//SPEECH[SPEAKER=$name]
qname
- a valid QName by which the variable is identified. Any
prefix should have been mapped to a namespace, using setNamespace(String, String)
.
For example, if a variable is called x:name, a prefix/namespace mapping should have
been defined for prefix x
before calling this method.initialValue
- the initial value, which is assigned to the variable
XMLDBException
void importModuleNamespace(java.lang.String ncname, java.lang.String namespaceURI) throws XMLDBException
importModuleNamespace("math", "http://example.org/math");This method is unique to the Sedna XML:DB API, and is not part of the original XML:DB API specification. Only use this method if you declare variables using
declareVariable(String qname, Object initialValue)and you wish to import a module by namespace.
ncname
- a valid NCName by which the namespace URI will be associated with.namespaceURI
- a valid URI which identifies a module within Sedna.
XMLDBException
void setXPathCompatibility(boolean backwardsCompatible)
backwardsCompatible
- void setModuleLoadPath(java.lang.String path)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |