net.sf.saxon.sxpath
Interface XPathStaticContext

All Superinterfaces:
StaticContext
All Known Implementing Classes:
DedicatedStaticContext, IndependentContext, SchemaElement.XPathStaticContext

public interface XPathStaticContext
extends StaticContext

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.
 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, getRequiredContextItemType, getSystemId, getURIForPrefix, getXPathLanguageLevel, isAllowedBuiltInType, isImportedSchema, isInBackwardsCompatibleMode, isSchemaAware, issueWarning, makeEarlyEvaluationContext
 

Method Detail

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) 2004-2011 Saxonica Limited. All rights reserved.