/** * Get the underlying Saxon implementation object representing this node. This provides * access to classes and methods in the Saxon implementation that may be subject to change * from one release to another. * * @return the underlying implementation object */ public NodeInfo getUnderlyingNode() { return getUnderlyingValue(); }
/** * Get the underlying Saxon implementation object representing this node. This provides * access to classes and methods in the Saxon implementation that may be subject to change * from one release to another. * * @return the underlying implementation object */ public NodeInfo getUnderlyingNode() { return (NodeInfo) getUnderlyingValue(); }
/** * Get the underlying Saxon implementation object representing this node. This provides * access to classes and methods in the Saxon implementation that may be subject to change * from one release to another. * * @return the underlying implementation object */ public NodeInfo getUnderlyingNode() { return getUnderlyingValue(); }
@Override public Item getItem(XPathContext context) throws XPathException { return doc.getUnderlyingValue().head(); }
@Override public Item getItem(XPathContext context) throws XPathException { return doc.getUnderlyingValue().head(); }
/** * Construct a QName from a lexical QName, supplying an element node whose * in-scope namespaces are to be used to resolve any prefix contained in the QName. * <p>This constructor checks that the components of the QName are * lexically valid.</p> * <p>If the lexical QName has no prefix, the name is considered to be in the * default namespace, as defined by <code>xmlns="..."</code>.</p> * <p>If the prefix of the lexical QName is not in scope, returns null.</p> * * @param lexicalQName The lexical QName, in the form <code>prefix:local</code> * or simply <code>local</code>. The EQName syntax "Q{uri}local" * and the ClarkName syntax "{uri}local" are also accepted. * @param element The element node whose in-scope namespaces are to be used * to resolve the prefix part of the lexical QName. * @throws IllegalArgumentException If the prefix of the lexical QName is not in scope * or if the lexical QName is invalid (for example, if it contains invalid characters) */ public QName(String lexicalQName, XdmNode element) { if (lexicalQName.startsWith("{")) { lexicalQName = "Q" + lexicalQName; } try { NodeInfo node = (NodeInfo) element.getUnderlyingValue(); sqName = StructuredQName.fromLexicalQName(lexicalQName, true, true, new InscopeNamespaceResolver(node)); } catch (XPathException err) { throw new IllegalArgumentException(err); } }
/** * Construct a QName from a lexical QName, supplying an element node whose * in-scope namespaces are to be used to resolve any prefix contained in the QName. * <p>This constructor checks that the components of the QName are * lexically valid.</p> * <p>If the lexical QName has no prefix, the name is considered to be in the * default namespace, as defined by <code>xmlns="..."</code>.</p> * <p>If the prefix of the lexical QName is not in scope, returns null.</p> * * @param lexicalQName The lexical QName, in the form <code>prefix:local</code> * or simply <code>local</code>. The EQName syntax "Q{uri}local" * and the ClarkName syntax "{uri}local" are also accepted. * @param element The element node whose in-scope namespaces are to be used * to resolve the prefix part of the lexical QName. * @throws IllegalArgumentException If the prefix of the lexical QName is not in scope * or if the lexical QName is invalid (for example, if it contains invalid characters) */ public QName(String lexicalQName, XdmNode element) { if (lexicalQName.startsWith("{")) { lexicalQName = "Q" + lexicalQName; } try { NodeInfo node = (NodeInfo) element.getUnderlyingValue(); sqName = StructuredQName.fromLexicalQName(lexicalQName, true, true, new InscopeNamespaceResolver(node)); } catch (XPathException err) { throw new IllegalArgumentException(err); } }
/** * Construct a QName from a lexical QName, supplying an element node whose * in-scope namespaces are to be used to resolve any prefix contained in the QName. * * <p>This constructor checks that the components of the QName are * lexically valid.</p> * <p>If the lexical QName has no prefix, the name is considered to be in the * default namespace, as defined by <code>xmlns="..."</code>.</p> * <p>If the prefix of the lexical QName is not in scope, returns null.</p> * * @param lexicalQName The lexical QName, in the form <code>prefix:local</code> * or simply <code>local</code>. * @param element The element node whose in-scope namespaces are to be used * to resolve the prefix part of the lexical QName. * @throws IllegalArgumentException If the prefix of the lexical QName is not in scope * or if the lexical QName is invalid (for example, if it contains invalid characters) */ public QName(String lexicalQName, XdmNode element) { try { NodeInfo node = (NodeInfo) element.getUnderlyingValue(); sqName = StructuredQName.fromLexicalQName(lexicalQName, true, node.getConfiguration().getNameChecker(), new InscopeNamespaceResolver(node)); } catch (XPathException err) { throw new IllegalArgumentException(err); } }
@Override public Receiver resolve(XPathContext context, String href, String baseUri, SerializationProperties properties) throws XPathException { URI absolute = getAbsoluteUri(href, baseUri); XdmDestination destination = new XdmDestination(); destination.setDestinationBaseURI(absolute); destination.onClose(() -> { XdmNode root = destination.getXdmNode(); results.put(absolute.toASCIIString(), root.getUnderlyingValue().getTreeInfo()); }); return destination.getReceiver(context.getReceiver().getPipelineConfiguration(), properties); }
@Override public Receiver resolve(XPathContext context, String href, String baseUri, SerializationProperties properties) throws XPathException { URI absolute = getAbsoluteUri(href, baseUri); XdmDestination destination = new XdmDestination(); destination.setDestinationBaseURI(absolute); destination.onClose(() -> { XdmNode root = destination.getXdmNode(); results.put(absolute.toASCIIString(), root.getUnderlyingValue().getTreeInfo()); }); return destination.getReceiver(context.getReceiver().getPipelineConfiguration(), properties); }