【发布时间】:2019-07-30 22:06:20
【问题描述】:
ancestor 根据https://www.w3schools.com/xml/xpath_axes.asp 表示Selects all ancestors (parent, grandparent, etc.) of the current node。
有没有办法指定最低的祖先而不是所有的祖先?
【问题讨论】:
-
不确定我是否理解。 “最低”的祖先总是根
/。 -
@PaulProgrammer,我相信大多数人会认为
/是“最高”的祖先,而parent::node()是“最低的”。 (计算机科学中的树传统上是用根高于叶子的方式绘制的。此外,文档排序强化了文档底部“低于”顶部的概念。) -
最深、最近等...