Code example for XPathFactory

Methods: newXPath

0
     * 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() {
        XPath xpath = sFactory.newXPath();
        xpath.setNamespaceContext(AndroidNamespaceContext.getDefault());
        return xpath;
    } 
}