Different results selecting HTML elements with XPath in Firefox and Internet Explorer

后端 未结 10 791
-上瘾入骨i
-上瘾入骨i 2021-01-18 10:34

I\'m trying to select a specific HTML element in a document, for firefox i just use:

xpathobj = document.evaluate(xpath, document, null,
               XPath         


        
10条回答
  •  梦谈多话
    2021-01-18 11:27

    Take a look at http://dev.abiss.gr/sarissa/ project. They have migrated most of XML-related APIs to IE. Otherwise it is indeed also easy to implement. The problems you would need to solve would be: serialization of HTML into valid XML, syncing result of XMLDOM XPath query with original HTMLDOM. To my knowledge they've done it in their library, however, its performance could have been better.

提交回复
热议问题