views:

50

answers:

1

I have a large set of XPaths for selecting content in webpages and I want users to be able to use them in the browser (including IE).

What do you recommend? Try and interpret the XPaths with JavaScript?
Or perhaps convert to regex?

Some existing JavaScript XPath work:
http://js-xpath.sourceforge.net/xpath-example.html
http://goog-ajaxslt.sourceforge.net

+1  A: 

I would look for an XSLT javascript library. Since most modern browsers have built-in XSLT support, and XSLT includes support for XPath, it is possible to use that engine to power your XPath selectors.

Personally, I've used Sarissa and the Glyphix jQuery.xslTransform libraries successfully:

This looks interesting too:

Docunext