/** * Adapts any DOM node to resolve namespaces so that an XPath expression * can be easily evaluated relative to the context of the node where it * appeared within the document. This adapter works like the DOM Level 3 * method <code>lookupNamespaceURI</code> on nodes in resolving the * namespaceURI from a given prefix using the current information available * in the node's hierarchy at the time lookupNamespaceURI is called, also * correctly resolving the implicit xml prefix. * * @param nodeResolver The node to be used as a context for namespace * resolution. * @return <code>XPathNSResolver</code> which resolves namespaces with * respect to the definitions in scope for a specified node. * * @see org.w3c.dom.xpath.XPathEvaluator#createNSResolver(Node) */ public XPathNSResolver createNSResolver(Node nodeResolver) { return new XPathNSResolverImpl((nodeResolver.getNodeType() == Node.DOCUMENT_NODE) ? ((Document) nodeResolver).getDocumentElement() : nodeResolver); }
/** * Adapts any DOM node to resolve namespaces so that an XPath expression * can be easily evaluated relative to the context of the node where it * appeared within the document. This adapter works like the DOM Level 3 * method <code>lookupNamespaceURI</code> on nodes in resolving the * namespaceURI from a given prefix using the current information available * in the node's hierarchy at the time lookupNamespaceURI is called, also * correctly resolving the implicit xml prefix. * * @param nodeResolver The node to be used as a context for namespace * resolution. * @return <code>XPathNSResolver</code> which resolves namespaces with * respect to the definitions in scope for a specified node. * * @see org.w3c.dom.xpath.XPathEvaluator#createNSResolver(Node) */ public XPathNSResolver createNSResolver(Node nodeResolver) { return new XPathNSResolverImpl((nodeResolver.getNodeType() == Node.DOCUMENT_NODE) ? ((Document) nodeResolver).getDocumentElement() : nodeResolver); }
/** * Adapts any DOM node to resolve namespaces so that an XPath expression * can be easily evaluated relative to the context of the node where it * appeared within the document. This adapter works like the DOM Level 3 * method <code>lookupNamespaceURI</code> on nodes in resolving the * namespaceURI from a given prefix using the current information available * in the node's hierarchy at the time lookupNamespaceURI is called, also * correctly resolving the implicit xml prefix. * * @param nodeResolver The node to be used as a context for namespace * resolution. * @return <code>XPathNSResolver</code> which resolves namespaces with * respect to the definitions in scope for a specified node. * * @see org.w3c.dom.xpath.XPathEvaluator#createNSResolver(Node) */ public XPathNSResolver createNSResolver(Node nodeResolver) { return new XPathNSResolverImpl((nodeResolver.getNodeType() == Node.DOCUMENT_NODE) ? ((Document) nodeResolver).getDocumentElement() : nodeResolver); }
/** * Adapts any DOM node to resolve namespaces so that an XPath expression * can be easily evaluated relative to the context of the node where it * appeared within the document. This adapter works like the DOM Level 3 * method <code>lookupNamespaceURI</code> on nodes in resolving the * namespaceURI from a given prefix using the current information available * in the node's hierarchy at the time lookupNamespaceURI is called, also * correctly resolving the implicit xml prefix. * * @param nodeResolver The node to be used as a context for namespace * resolution. * @return <code>XPathNSResolver</code> which resolves namespaces with * respect to the definitions in scope for a specified node. * * @see org.w3c.dom.xpath.XPathEvaluator#createNSResolver(Node) */ public XPathNSResolver createNSResolver(Node nodeResolver) { return new XPathNSResolverImpl((nodeResolver.getNodeType() == Node.DOCUMENT_NODE) ? ((Document) nodeResolver).getDocumentElement() : nodeResolver); }