Cross-browser XPath implementation in JavaScript

前端 未结 12 1428
有刺的猬
有刺的猬 2020-12-08 04:32

I\'m looking for a XPath library to query over XML documents in FF, IE, Opera and Safari... and couldn\'t find one. Have you seen any?

相关标签:
12条回答
  • 2020-12-08 05:05

    I think you can use Cameron McCormack's xpath library here. It's perfectly working for me.

    0 讨论(0)
  • 2020-12-08 05:06

    Google has just released Wicked Good XPath - A rewrite of Cybozu Lab's famous JavaScript-XPath.

    Link: https://github.com/google/wicked-good-xpath

    The rewritten version is 40% smaller and about 30% faster than the original implementation.

    0 讨论(0)
  • 2020-12-08 05:06

    You could make use of the existing native DOM support of each browser. For this you would have to create your own wrapper, the reason is the differences between browser. You can take a look at http://dotnetcaffe.blogspot.com

    Best regards

    0 讨论(0)
  • 2020-12-08 05:08

    The other option could be LlamaLab XPath.js (though seems to be a bit old)

    0 讨论(0)
  • 2020-12-08 05:09

    You may want to try jQuery XPath plugin with support for XPath 2.0 syntax that works cross-browser.

    0 讨论(0)
  • 2020-12-08 05:13

    I don't think it allows for ad-hoc queries, but you might take a look at Johann Burkard's XSLT jQuery plug-in for inspiration on how to implement XPath queries. I use it in my jQuery Reference Dashboard widget and it's really solid.

    0 讨论(0)
提交回复
热议问题