levand/domina — Issue #12: Discuss XPath on Android
Author: djpowell
Created: 2012-02-05 09:49:58+00:00
State: open

I thought it might be worth mentioning Android support in the documentation.

Android 2.x (which has a 95% share on Android devices), doesn't implement XPath, but it erroneously claims that it does via the document.implementation.hasFeature mechanism. This causes xpath.js to refuse to install.

By detecting this, and setting the useNative: false config option, prior to loading xpath.js, android will use the xpath.js implementation and work fine.

```html

```

So, three things are currently an issue in preventing Android 2.x from working:

1. Android doesn't natively support xpath.js
2. xpath.js isn't loaded on Android, due to the conditional comment
3. Android lies about its non-existent xpath support, causing xpath.js to not install, unless useNative is explicitly overridden