使用XPath获取属性Mozilla Firefox无法使用最新版本

时间:2014-12-18 12:52:06

标签: javascript html5 firefox xpath mozilla

一位用户刚才问过这个问题。为什么不使用最新版本的Mozilla?

Getting attribute using XPath

给出如此的XML结构:

<bookstore>

<book>
  <title lang="eng">Harry Potter</title>
  <price>29.99</price>
</book>

<book>
  <title lang="eng">Learning XML</title>
  <price>39.95</price>
</book>

</bookstore>

我正在使用这个表达式:

path="/bookstore/book/title/@lang";

适用于Google Chrome,Opera,Internet Explorer,Safari。但不是在Mozilla Firefox中。只有属性(@或属性:)才会发生。

我在Mozilla 6中尝试过并且完美无缺,但在Mozilla 33或34中却没有。

0 个答案:

没有答案