zhegexiaohuozi/JsoupXpath

position函数对比不支持count函数

Ruffianjiang opened this issue · 2 comments

Please answer these questions before submitting your issue. Thanks!

  1. What did you do , If possible, provide a recipe for reproducing the error.(使用的表达式与使用场景,确保能够复现)?
<bookstore>

<book category="COOKING">
  <title lang="en">Everyday Italian</title>
  <author>Giada De Laurentiis</author>
  <year>2005</year>
  <price>30.00</price>
</book>

<book category="CHILDREN">
  <title lang="en">Harry Potter</title>
  <author>J K. Rowling</author>
  <year>2005</year>
  <price>29.99</price>
</book>

<book category="WEB">
  <title lang="en">XQuery Kick Start</title>
  <author>James McGovern</author>
  <author>Per Bothner</author>
  <author>Kurt Cagle</author>
  <author>James Linn</author>
  <author>Vaidyanathan Nagarajan</author>
  <year>2003</year>
  <price>49.99</price>
</book>

<book category="WEB">
  <title lang="en">Learning XML</title>
  <author>Erik T. Ray</author>
  <year>2003</year>
  <price>39.95</price>
</book>

</bookstore>

类似语法如下:
"/bookstore/book[position()<count(/bookstore/book)]/price"
"/bookstore/book[position()<count(/bookstore/book)-1]/price"
"/bookstore/book[position()<count(/bookstore/book)-1]/price"
"/bookstore/book[position()<count(/bookstore/book)-sum(/bookstore/book/year)]/price"
2. What did you expect to see(期望看到什么)?

  1. What did you see instead(JsoupXpath给出的结果)?

语法报错

  1. What version of JsoupXpath are you using(当前版本)?
    2.5.0

下一版中修复