Interface XPathStaticContext

  • All Superinterfaces:
    StaticContext
    All Known Implementing Classes:
    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 Detail

      • setDefaultElementNamespace

        void setDefaultElementNamespace​(NamespaceUri 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.
        Parameters:
        qname - The name of the variable
        Returns:
        a Variable object representing information about the variable that has been declared.
      • declareVariable

        XPathVariable declareVariable​(NamespaceUri namespaceURI,
                                      java.lang.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.
        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.
      • isContextItemParentless

        boolean isContextItemParentless()
        Ask whether the context item is known to be parentless
        Returns:
        true if it is known that the context item for evaluating the expression will have no parent