net.sf.saxon.sxpath
Interface XPathStaticContext

All Superinterfaces:
Container, Serializable, SourceLocator, StaticContext
All Known Implementing Classes:
IndependentContext

public interface XPathStaticContext
extends StaticContext, Container

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.


Method Summary
 XPathVariable declareVariable(QNameValue qname)
          Declare a variable.
 XPathVariable declareVariable(String namespaceURI, String localName)
          Declare a variable.
 Executable getExecutable()
          Get the executable associated with this static context.
 SlotManager getStackFrameMap()
          Get a Stack Frame Map containing definitions of all the declared variables.
 void setDefaultElementNamespace(String uri)
          Set the default namespace for elements and types
 void setNamespaceResolver(NamespaceResolver resolver)
          Set an external namespace resolver.
 
Methods inherited from interface net.sf.saxon.expr.StaticContext
bindVariable, getBaseURI, getCollation, getConfiguration, getDecimalFormatManager, getDefaultCollationName, getDefaultElementNamespace, getDefaultFunctionNamespace, getFunctionLibrary, getImportedSchemaNamespaces, getLineNumber, getLocationMap, getNamePool, getNamespaceResolver, getSystemId, getURIForPrefix, isAllowedBuiltInType, isImportedSchema, isInBackwardsCompatibleMode, issueWarning, makeEarlyEvaluationContext
 
Methods inherited from interface net.sf.saxon.expr.Container
getContainerGranularity, getHostLanguage, getLocationProvider
 
Methods inherited from interface javax.xml.transform.SourceLocator
getColumnNumber, getLineNumber, getPublicId, getSystemId
 

Method Detail

getExecutable

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.

Specified by:
getExecutable in interface Container
Specified by:
getExecutable in interface StaticContext
Returns:
the Executable

setDefaultElementNamespace

void setDefaultElementNamespace(String uri)
Set the default namespace for elements and types

Parameters:
uri - The namespace to be used to qualify unprefixed element names and type names appearing in the XPath expression.

setNamespaceResolver

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.

Parameters:
resolver - the external namespace resolver

declareVariable

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(java.lang.String, java.lang.String) method.

Parameters:
qname - The name of the variable
Returns:
a Variable object representing information about the variable that has been declared.

declareVariable

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(java.lang.String, java.lang.String) method.

Parameters:
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)
Returns:
an XPathVariable object representing information about the variable that has been declared.

getStackFrameMap

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.

Returns:
a SlotManager object holding details of the allocation of variables on the stack frame.


Copyright (c) Saxonica Limited. All rights reserved.