給IE增加dom3xpath支援

來源:互聯網
上載者:User

Dimitri Glazkov's html-xpath provides DOM level 3 XPath features for M$IE. I found it first from Sarissa docs which mentions it as complement to Sarissa.

Great, is it? But it still have some limits:

1. It only works for html document of current window!
Yes, M$IE xml DOM provides selectNodes/selectSingleNode, but these methods can not return number/boolean/string value. So I'd rather insist on more full-desiged dom3xpath standard api.

2. It maybe have some 'unsolvable' performance issues according to the author.

3. Due to short of getter/setter, it doesn't provide read-only properties as spec recommends, instead of result.xxxValue, it use java-style binding: result.getXxxValue(). This brings some inconvenient and trivial work when migrate codes from other implementation (ie. Mozilla).

I plan to overcome the 1st (in some degree, the 2nd) limit. Here is my work in process.

 

Appendix: my letter to Dimitri Glazkov

Great work! I want to use in in my product.
But it seems that u have no plan to improve it? What are "unsolvable performance issues"? If it is because of recursive calls of loadNode(), i think such codes can be dropped.
My initial requirement is XPath api for any document, not only html. So i modified some codes. After reading the codes, i have a question, why u must call selectNodes and transformNode method from document(what your _XPathMsxmlDocumentHelper.getDOM returns), every node have these two methods, so why not call result._contextNode.selectNodes or result._contextNode.transformNode ? And in such calling, u don't need to adjust expression or loadDocument at all.
Maybe I missed sth important

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.