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);
Stop searching for code, let great code find you!  Add Codota to your java IDE