我需要获得一些值的路径,然而我正在工作的Xquery环境不支持这种语法for $ancestor in $datum/ancestor-or-self::*特别是这个轴导致问题ancestor-or-self::*。似乎无法弄清楚这一点。任何帮助表示赞赏
for $ancestor in $datum/ancestor-or-self::*
ancestor-or-self::*
在没有ancestor*轴的情况下,您可以递归地爬上parent轴,或者使用root()函数来检索文档节点,然后沿着child或descendant轴下降。
ancestor*
parent
root()
child
descendant