Code example for XPathFactory

Methods: newXPath

     * Creates a new XPath object, specifying which prefix in the query is used for the 
     * android namespace. 
     * @param androidPrefix The namespace prefix. 
    public static XPath newXPath(String androidPrefix) {
        XPath xpath = sFactory.newXPath();
        xpath.setNamespaceContext(new AndroidNamespaceContext(androidPrefix));
        return xpath;
     * Creates a new XPath object using the default prefix for the android namespace. 
     * @see #DEFAULT_NS_PREFIX 
    public static XPath newXPath() {
        return newXPath(DEFAULT_NS_PREFIX);
Connect your IDE to all the code out there  Get Codota for Java