/** * Get the context item used for evaluating the XPath expression. * This may be either a node or an atomic value. Most commonly it will be a document node, * which might be constructed using the Build method of the DocumentBuilder object. * * @return The context item for evaluating the expression, or null if no context item * has been set. */ public XdmItem getContextItem() { return XdmItem.wrapItem(dynamicContext.getContextItem()); }
/** * Get the context item used for evaluating the XPath expression. * This may be either a node or an atomic value. Most commonly it will be a document node, * which might be constructed using the Build method of the DocumentBuilder object. * * @return The context item for evaluating the expression, or null if no context item * has been set. */ public XdmItem getContextItem() { return XdmItem.wrapItem(dynamicContext.getContextItem()); }
/** * Get the context item used for evaluating the XPath expression. * This may be either a node or an atomic value. Most commonly it will be a document node, * which might be constructed using the Build method of the DocumentBuilder object. * * @return The context item for evaluating the expression, or null if no context item * has been set. */ public XdmItem getContextItem() { return XdmItem.wrapItem(dynamicContext.getContextItem()); }
case BEFORE_ITEM: try { next = (T)XdmItem.wrapItem(base.next()); if (next == null) { state = FINISHED;
case BEFORE_ITEM: try { next = (T)XdmItem.wrapItem(base.next()); if (next == null) { state = FINISHED;
case BEFORE_ITEM: try { next = XdmItem.wrapItem(base.next()); if (next == null) { state = FINISHED;
/** * Create a node by wrapping a recognized external node from a supported object model. * The support module for the external object model must be on the class path and registered * with the Saxon configuration. * * <p>It is best to avoid calling this method repeatedly to wrap different nodes in the same document. * Each such wrapper conceptually creates a new XDM tree instance with its own identity. Although the * memory is shared, operations that rely on node identity might not have the expected result. It is * best to create a single wrapper for the document node, and then to navigate to the other nodes in the * tree using S9API interfaces.</p> * * @param node the node in the external tree representation * @return the supplied node wrapped as an XdmNode * @throws IllegalArgumentException if the type of object supplied is not recognized. This may be because * the required code is not on the class path */ public XdmNode wrap(Object node) throws IllegalArgumentException { ExternalObjectModel model = config.findExternalObjectModel(node); DocumentInfo doc = model.wrapDocument(node, (baseURI == null ? null : baseURI.toString()), config); NodeInfo wrappedNode = model.wrapNode(doc, node); return (XdmNode)XdmItem.wrapItem(wrappedNode); }
JPConverter converter = JPConverter.allocate(node.getClass(), null, config); NodeInfo nodeInfo = (NodeInfo) converter.convert(node, new EarlyEvaluationContext(config)); return XdmItem.wrapItem(nodeInfo); } catch (XPathException e) { throw new IllegalArgumentException(e.getMessage());
JPConverter converter = JPConverter.allocate(node.getClass(), null, config); NodeInfo nodeInfo = (NodeInfo) converter.convert(node, new EarlyEvaluationContext(config)); return (XdmNode) XdmItem.wrapItem(nodeInfo); } catch (XPathException e) { throw new IllegalArgumentException(e.getMessage());