org.apache.xalan.extensions

## Interface ExpressionContext

- All Known Implementing Classes:
    XPathContext.XPathExpressionContext

      public interface ExpressionContext

  An object that implements this interface can supply information about the current XPath expression context.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Node` | `getContextNode()` Get the current context node.
    `NodeIterator` | `getContextNodes()` Get the current context node list.
    `ErrorListener` | `getErrorListener()` Get the error listener.
    `XObject` | `getVariableOrParam(QName qname)` Get a variable based on it's qualified name.
    `XPathContext` | `getXPathContext()` Get the XPathContext that owns this ExpressionContext.
    `double` | `toNumber(Node n)` Get the value of a node as a number.
    `java.lang.String` | `toString(Node n)` Get the value of a node as a string.

- - ### Method Detail

    - #### getContextNode

          Node getContextNode()

      Get the current context node.
      Returns:
        The current context node.

    - #### getContextNodes

          NodeIterator getContextNodes()

      Get the current context node list.
      Returns:
        An iterator for the current context list, as defined in XSLT.

    - #### getErrorListener

          ErrorListener getErrorListener()

      Get the error listener.
      Returns:
        The registered error listener.

    - #### toNumber

          double toNumber(Node n)

      Get the value of a node as a number.
      Parameters:
        `n` - Node to be converted to a number. May be null.
      Returns:
        value of n as a number.

    - #### toString

          java.lang.String toString(Node n)

      Get the value of a node as a string.
      Parameters:
        `n` - Node to be converted to a string. May be null.
      Returns:
        value of n as a string, or an empty string if n is null.

    - #### getVariableOrParam

          XObject getVariableOrParam(QName qname)
                                     throws TransformerException

      Get a variable based on it's qualified name.
      Parameters:
        `qname` - The qualified name of the variable.
      Returns:
        The evaluated value of the variable.
      Throws:
        `TransformerException`

    - #### getXPathContext

          XPathContext getXPathContext()
                                       throws TransformerException

      Get the XPathContext that owns this ExpressionContext. Note: exslt:function requires the XPathContext to access the variable stack and TransformerImpl.
      Returns:
        The current XPathContext.
      Throws:
        `TransformerException`

Copyright © 2014 Apache XML Project. All Rights Reserved.