Short question: is the selectors API sensible for processing XML documents?
Longer question with the "why I'm asking"...
I'm in the progress of making some old code that makes use of client-side generated XML and XPath into something cross-browser that's happy on later versions of IE (10+) as well as down to IE7 (as well as Chrome, Firefox, etc...)
Now there's various questions around XPath support in IE and the fact it appears to be no longer cared for (no evaluate()
, no SelectNodes()
). Allegedly some classes have been whitelisted, but some testing seems to hint this is unreliable when ActiveX filtering is enabled in IE10.
I've played with wicked-good-xpath, but I've bumped into issues with some forms of XPath. In addition if IE is never going to have XPath support again, I'd rather not be permenantly reliant on an external library, and find the next "best" thing to use instead.
It's been pointed out that the selector API is now the recommended choice instead. The problem I have with this though is that it primarily appears to be a HTML selection API (mostly as it grew out of CSS and as such it has special cases for class and ID attributes - there maybe other HTML-isms I've not yet seen).
Thus is the selectors API sensible for processing XML documents? Given the lack of support in IE, the answer is probably "yes", but I can't see anything authoritative that gives a definite recommendation (or anti-recommendation).