/** * Get the initial context item for the query, if one has been set * @return the initial context item, or null if none has been set. This will not necessarily * be the same object as was supplied, but it will be an XdmItem object that represents * the same underlying node or atomic value. */ public XdmItem getContextItem() { return (XdmItem)XdmValue.wrap(context.getContextItem()); }
/** * Get the initial context item for the query, if one has been set * * @return the initial context item, or null if none has been set. This will not necessarily * be the same object as was supplied, but it will be an XdmItem object that represents * the same underlying node or atomic value. */ public XdmItem getContextItem() { Item<?> item = context.getContextItem(); if (item == null) { return null; } return (XdmItem) XdmValue.wrap(item); }
/** * Get the initial context item for the query, if one has been set * * @return the initial context item, or null if none has been set. This will not necessarily * be the same object as was supplied, but it will be an XdmItem object that represents * the same underlying node or atomic value. */ public XdmItem getContextItem() { Item<?> item = context.getContextItem(); if (item == null) { return null; } return (XdmItem) XdmValue.wrap(item); }
if (affectedDocuments.contains(dynamicEnv.getContextItem())) { QueryResult.serialize((NodeInfo)dynamicEnv.getContextItem(), new StreamResult(destination), outputProps);
private XPathContextMajor initialContext(DynamicQueryContext dynamicEnv, Controller controller) throws XPathException { Item contextItem = dynamicEnv.getContextItem(); controller.defineGlobalParameters(); XPathContextMajor context = controller.newXPathContext(); if (contextItem != null) { if (!staticContext.getUserQueryContext().getRequiredContextItemType().matchesItem( contextItem, false, dynamicEnv.getConfiguration())) { throw new XPathException("The supplied context item does not match the required context item type"); } UnfailingIterator single = SingletonIterator.makeIterator(contextItem); single.next(); context.setCurrentIterator(single); controller.setInitialContextItem(contextItem); } return context; }
private XPathContextMajor initialContext(DynamicQueryContext dynamicEnv, Controller controller) throws XPathException { Item contextItem = dynamicEnv.getContextItem(); controller.defineGlobalParameters(); XPathContextMajor context = controller.newXPathContext(); if (contextItem != null) { if (!staticContext.getUserQueryContext().getRequiredContextItemType().matchesItem( contextItem, false, dynamicEnv.getConfiguration())) { throw new XPathException("The supplied context item does not match the required context item type"); } UnfailingIterator single = SingletonIterator.makeIterator(contextItem); single.next(); context.setCurrentIterator(single); controller.setInitialContextItem(contextItem); } return context; }
Item contextItem = env.getContextItem();
Item contextItem = env.getContextItem();
throw new XPathException("The query must be compiled and executed under the same Configuration", SaxonErrorCode.SXXP0004); Item contextItem = env.getContextItem(); if (contextItem instanceof NodeInfo && ((NodeInfo) contextItem).getTreeInfo().isTyped() && !getExecutable().isSchemaAware()) { throw new XPathException("A typed input document can only be used with a schema-aware query");
throw new XPathException("The query must be compiled and executed under the same Configuration", SaxonErrorCode.SXXP0004); Item contextItem = env.getContextItem(); if (contextItem instanceof NodeInfo && ((NodeInfo) contextItem).getTreeInfo().isTyped() && !getExecutable().isSchemaAware()) { throw new XPathException("A typed input document can only be used with a schema-aware query");