Enhydra 3.1 API

org.apache.xalan.xpath
Interface XLocator

All Known Implementing Classes:
SimpleNodeLocator

public interface XLocator
extends java.io.Serializable

This interface provides services for processing a XPath LocationPath. Either the default implementation (SimpleNodeLocator) will be used to implement this interface, or an extension function that serves as a factory method can be used that returns an XLocator.


Method Summary
 XNodeSet connectToNodes(XPath xpath, XPathSupport execContext, Node context, int opPos, java.util.Vector connectArgs)
          Execute a connection (if it was not executed by the static connect method) and process the following LocationPath, if it is present.
 XNodeSet locationPath(XPath xpath, XPathSupport execContext, Node context, int opPos, NodeCallback callback, java.lang.Object callbackInfo, boolean stopAtFirst)
          Execute a location path.
 double locationPathPattern(XPath xpath, XPathSupport execContext, Node context, int opPos)
          Execute a location path pattern.
 XNodeSet union(XPath xpath, XPathSupport execContext, Node context, int opPos, NodeCallback callback, java.lang.Object callbackInfo)
          Execute a union.
 

Method Detail

connectToNodes

public XNodeSet connectToNodes(XPath xpath,
                               XPathSupport execContext,
                               Node context,
                               int opPos,
                               java.util.Vector connectArgs)
                        throws SAXException
Execute a connection (if it was not executed by the static connect method) and process the following LocationPath, if it is present. Normally, the connection functionality should be executed by this function and not the static connect function, which is really a factory method for the XLocator instance. The arguments to the static connect function are re-passed to this function.
Parameters:
xpath - The xpath that is executing.
context - The current source tree context node.
opPos - The current position in the xpath.m_opMap array.
connectArgs - The same arguments that were passed to the static connect function.

union

public XNodeSet union(XPath xpath,
                      XPathSupport execContext,
                      Node context,
                      int opPos,
                      NodeCallback callback,
                      java.lang.Object callbackInfo)
               throws SAXException
Execute a union. The union of its operands, which are locationPaths, must be node-sets.
Parameters:
xpath - The xpath that is executing.
execContext - The execution context.
context - The current source tree context node.
opPos - The current position in the xpath.m_opMap array.
callback - Interface that implements the processLocatedNode method.
callbackInfo - Object that will be passed to the processLocatedNode method.

locationPath

public XNodeSet locationPath(XPath xpath,
                             XPathSupport execContext,
                             Node context,
                             int opPos,
                             NodeCallback callback,
                             java.lang.Object callbackInfo,
                             boolean stopAtFirst)
                      throws SAXException
Execute a location path. Normally, this method simply moves past the OP_LOCATIONPATH and it's length member, and calls the Step function, which will recursivly process the rest of the LocationPath, and then wraps the NodeList result in an XNodeSet object.
Parameters:
xpath - The xpath that is executing.
context - The current source tree context node.
opPos - The current position in the xpath.m_opMap array.
callback - Interface that implements the processLocatedNode method.
callbackInfo - Object that will be passed to the processLocatedNode method.
stopAtFirst - True if only the first found node in doc order is needed.

locationPathPattern

public double locationPathPattern(XPath xpath,
                                  XPathSupport execContext,
                                  Node context,
                                  int opPos)
                           throws SAXException
Execute a location path pattern. This will return a score of MATCH_SCORE_NONE, MATCH_SCORE_NODETEST, MATCH_SCORE_OTHER, MATCH_SCORE_QNAME.
Parameters:
xpath - The xpath that is executing.
context - The current source tree context node.
opPos - The current position in the xpath.m_opMap array.

Enhydra 3.1 API