Code example for XPath

Methods: setNamespaceContext

     * 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);
Contextual code suggestions in your IDE  Get Codota for Java