net.sf.saxon.sxpath
Interface XPathStaticContext
- Container, Serializable, SourceLocator, StaticContext
- IndependentContext
public interface XPathStaticContext
This interface defines methods that must be provided when Saxon's free-standing XPath API is used.
The default implementation of this interface is
IndependentContext
, and
that implementation should be adequate for most purposes; but for extra customization, a user-written
implementation of this interface may be used instead.
bindVariable , getBaseURI , getCollation , getConfiguration , getDefaultCollationName , getDefaultElementNamespace , getDefaultFunctionNamespace , getFunctionLibrary , getImportedSchemaNamespaces , getLineNumber , getLocationMap , getNamePool , getNamespaceResolver , getSystemId , getURIForPrefix , isAllowedBuiltInType , isImportedSchema , isInBackwardsCompatibleMode , issueWarning , makeEarlyEvaluationContext |
declareVariable
public XPathVariable declareVariable(String namespaceURI,
String localName)
Declare a variable. A variable must be declared before an expression referring
to it is compiled. The initial value of the variable will be the empty sequence.
This method backs up the
XPathEvaluator.declareVariable(String,String)
method.
namespaceURI
- The namespace URI of the name of the variable. Supply "" to represent
names in no namespace (null is also accepted)localName
- The local part of the name of the variable (an NCName)
- an XPathVariable object representing information about the variable that has been
declared.
declareVariable
public XPathVariable declareVariable(QNameValue qname)
Declare a variable. A variable must be declared before an expression referring
to it is compiled. The initial value of the variable will be the empty sequence.
This method backs up the
XPathEvaluator.declareVariable(String,String)
method.
qname
- The name of the variable
- a Variable object representing information about the variable that has been
declared.
getExecutable
public Executable getExecutable()
Get the executable associated with this static context. The Executable generally holds details
of function libraries and collations. For freestanding XPath expressions, there will generally
be a single executable corresponding one-to-one with the static context object, and which can be
created as soon as the Configuration is known.
- getExecutable in interface Container
getStackFrameMap
public SlotManager getStackFrameMap()
Get a Stack Frame Map containing definitions of all the declared variables. This will return a newly
created object that the caller is free to modify by adding additional variables, without affecting
the static context itself.
- a SlotManager object holding details of the allocation of variables on the stack frame.
setDefaultElementNamespace
public void setDefaultElementNamespace(String uri)
Set the default namespace for elements and types
uri
- The namespace to be used to qualify unprefixed element names and type names appearing
in the XPath expression.
setNamespaceResolver
public void setNamespaceResolver(NamespaceResolver resolver)
Set an external namespace resolver. If this is set, then all resolution of namespace
prefixes is delegated to the external namespace resolver, and namespaces declared
individually on this IndependentContext object are ignored.
resolver
- the external namespace resolver