/** * Make an XPathContext object for expression evaluation. * <p> * This method is intended for internal use. * * @return the new XPathContext */ public XPathContextMajor newXPathContext() { return new XPathContextMajor(this); }
/** * Make an XPathContext object for expression evaluation. * <p> * This method is intended for internal use. * * @return the new XPathContext */ public XPathContextMajor newXPathContext() { return new XPathContextMajor(this); }
/** * Construct a new context as a copy of another. The new context is effectively added * to the top of a stack, and contains a pointer to the previous context. */ public XPathContextMajor newContext() { XPathContextMajor c = new XPathContextMajor(); c.controller = controller; c.currentIterator = currentIterator; c.stackFrame = stackFrame; c.localParameters = localParameters; c.tunnelParameters = tunnelParameters; c.last = last; c.currentReceiver = currentReceiver; c.currentDestination = currentDestination; c.currentMode = currentMode; c.currentTemplate = currentTemplate; c.currentRegexIterator = currentRegexIterator; c.currentGroupIterator = currentGroupIterator; c.currentMergeGroupIterator = currentMergeGroupIterator; c.currentException = currentException; c.caller = this; c.tailCallInfo = null; c.temporaryOutputState = temporaryOutputState; c.threadManager = threadManager; c.currentComponent = currentComponent; c.errorListener = errorListener; c.uriResolver = uriResolver; return c; }
/** * Make an XPathContext object for expression evaluation. * <p>This method is intended for internal use.</p> * * @return the new XPathContext */ public XPathContextMajor newXPathContext() { XPathContextMajor c = new XPathContextMajor(this); c.setCurrentOutputUri(principalResultURI); return c; }
/** * Make an XPathContext object for expression evaluation. * <p>This method is intended for internal use.</p> * * @return the new XPathContext */ public XPathContextMajor newXPathContext() { XPathContextMajor c = new XPathContextMajor(this); c.setCurrentOutputUri(principalResultURI); return c; }
/** * Construct a new context without copying (used for the context in a function call) */ public XPathContextMajor newCleanContext() { XPathContextMajor c = new XPathContextMajor(getController()); c.setCaller(this); return c; }
/** * Construct a new context without copying (used for the context in a function call) */ public XPathContextMajor newCleanContext() { XPathContextMajor c = new XPathContextMajor(getController()); c.setCaller(this); return c; }
/** * Construct a new context without copying (used for the context in a function call) */ public XPathContextMajor newCleanContext() { XPathContextMajor c = new XPathContextMajor(getController()); c.setCaller(this); return c; }
/** * Construct a new context without copying (used for the context in a function call) */ public XPathContextMajor newCleanContext() { XPathContextMajor c = new XPathContextMajor(getController()); c.setCaller(this); return c; }
/** * Construct a new context without copying (used for the context in a function call) */ public XPathContextMajor newCleanContext() { XPathContextMajor c = new XPathContextMajor(getController()); c.setCaller(this); return c; }
/** * Get a raw iterator over the results of the expression. This returns results without * any conversion of the returned items to "native" Java classes. This method is intended * for use by applications that need to process the results of the expression using * internal Saxon interfaces. * @param contextItem the context item for evaluating the expression * @return an iterator over the results of the expression, with no conversion of returned items * @since 9.0 */ public SequenceIterator rawIterator(Item contextItem) throws XPathException { XPathContextMajor context = new XPathContextMajor(contextItem, executable); context.openStackFrame(stackFrameMap); return rawIterator(context); }
/** * Create a dynamic context suitable for evaluating this expression, without supplying a context * item * * @return an XPathDynamicContext object representing a suitable dynamic context. This will * be initialized with a stack frame suitable for holding the variables used by the * expression. */ public XPathDynamicContext createDynamicContext() { XPathContextMajor context = new XPathContextMajor(null, executable); context.openStackFrame(stackFrameMap); return new XPathDynamicContext(env.getRequiredContextItemType(), context, stackFrameMap); }
/** * Create a dynamic context suitable for evaluating this expression * @param contextItem the initial context item, which may be null if no * context item is required, or if it is to be supplied later * @return an XPathDynamicContext object representing a suitable dynamic context. This will * be initialized with a stack frame suitable for holding the variables used by the * expression. */ public XPathDynamicContext createDynamicContext(Item contextItem) { XPathContextMajor context = new XPathContextMajor(contextItem, evaluator.getExecutable()); context.openStackFrame(stackFrameMap); return new XPathDynamicContext(context, stackFrameMap); }
/** * Create a dynamic context suitable for evaluating this expression, without supplying a context * item * * @return an XPathDynamicContext object representing a suitable dynamic context. This will * be initialized with a stack frame suitable for holding the variables used by the * expression. */ public XPathDynamicContext createDynamicContext() { XPathContextMajor context = new XPathContextMajor(null, executable); context.openStackFrame(stackFrameMap); return new XPathDynamicContext(env.getRequiredContextItemType(), context, stackFrameMap); }
/** * Create a dynamic context suitable for evaluating this expression * @param contextItem the initial context item, which may be null if no * context item is required, or if it is to be supplied later * @return an XPathDynamicContext object representing a suitable dynamic context. This will * be initialized with a stack frame suitable for holding the variables used by the * expression. */ public XPathDynamicContext createDynamicContext(Item contextItem) { XPathContextMajor context = new XPathContextMajor(contextItem, evaluator.getExecutable()); context.openStackFrame(stackFrameMap); return new XPathDynamicContext(context); }
XPathContext getXPathContext(TestEntry test, String sourcesName, XdmNode contextNode) throws Exception { XPathContext context = null; if (test.usesContext()) { XsltExecutable xe = engine.loadExecutable(test, sourcesName); Executable ex = xe.getUnderlyingCompiledStylesheet() .getExecutable(); context = new XPathContextMajor(contextNode.getUnderlyingNode(), ex); } return context; }
/** * Create a dynamic context suitable for evaluating this expression * * @param contextItem the initial context item, which may be null if no * context item is required, or if it is to be supplied later * @return an XPathDynamicContext object representing a suitable dynamic context. This will * be initialized with a stack frame suitable for holding the variables used by the * expression. * @throws XPathException if the context item does not match the required context item type * set up in the static context */ public XPathDynamicContext createDynamicContext(Item contextItem) throws XPathException { checkContextItemType(contextItem); XPathContextMajor context = new XPathContextMajor(contextItem, executable); context.openStackFrame(stackFrameMap); return new XPathDynamicContext(env.getRequiredContextItemType(), context, stackFrameMap); }
/** * Create a dynamic context suitable for evaluating this expression * * @param contextItem the initial context item, which may be null if no * context item is required, or if it is to be supplied later * @return an XPathDynamicContext object representing a suitable dynamic context. This will * be initialized with a stack frame suitable for holding the variables used by the * expression. * @throws XPathException if the context item does not match the required context item type * set up in the static context */ public XPathDynamicContext createDynamicContext(Item contextItem) throws XPathException { checkContextItemType(contextItem); XPathContextMajor context = new XPathContextMajor(contextItem, executable); context.openStackFrame(stackFrameMap); return new XPathDynamicContext(env.getRequiredContextItemType(), context, stackFrameMap); }
XPathContext getXPathContext(TestEntry test, String sourcesName, XdmNode contextNode) throws Exception { XPathContext context = null; if (test.usesContext()) { XsltExecutable xe = engine.loadExecutable(test, sourcesName); Executable ex = xe.getUnderlyingCompiledStylesheet() .getExecutable(); context = new XPathContextMajor(contextNode.getUnderlyingNode(), ex); } return context; }
/** * Execute a prepared XPath expression, returning the results as a List. The context * node must have been set previously using {@link #setContextNode(net.sf.saxon.om.NodeInfo)}. * @return The results of the expression, as a List. The List represents the sequence * of items returned by the expression. Each item in the list will either be an instance * of net.sf.saxon.om.NodeInfo, representing a node, or a Java object representing an atomic value. * For the types of Java object that may be returned, see {@link #evaluate(Object, javax.xml.namespace.QName)} * with the second argument set to NODESET. * @deprecated since 9.0. This method is not present in the JAXP interface. Either use * the JAXP methods such as {@link #evaluate(Object, QName)}, or use the Saxon XPath * API instead of JAXP. */ public List evaluate() throws XPathException { XPathContextMajor context = new XPathContextMajor(contextNode, executable); context.openStackFrame(stackFrameMap); SequenceIterator iter = expression.iterate(context); SequenceExtent extent = new SequenceExtent(iter); return (List)extent.convertToJava(Object.class, context); }