Here you can find the source of selectNodeIterator(Node nContextNode, String sXPath)
Parameter | Description |
---|---|
nContextNode | The node to start searching from. |
sXPath | A valid XPath string. |
Parameter | Description |
---|---|
TransformerException | an exception |
public static NodeIterator selectNodeIterator(Node nContextNode, String sXPath) throws TransformerException
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; import javax.xml.transform.TransformerException; import org.w3c.dom.Node; import org.w3c.dom.traversal.NodeIterator; public class Main { /** Holds the method for executing the selectNodeIterator method. */ private static Method s_mSelectNodeIterator; /**/*from ww w .ja va 2s. co m*/ * Use an XPath string to select a nodelist. XPath namespace prefixes are resolved from the contextNode. * * @param nContextNode The node to start searching from. * @param sXPath A valid XPath string. * @return A NodeIterator, should never be null. * @throws TransformerException */ public static NodeIterator selectNodeIterator(Node nContextNode, String sXPath) throws TransformerException { try { return (NodeIterator) s_mSelectNodeIterator.invoke(null, new Object[] { nContextNode, sXPath }); } catch (Exception e) { throw new TransformerException(e); } } }