XSLT/Xpath : Why is it not possible to use the shortened notation for parent for the use attribute of the key function

标签 xslt xpath

似乎不可能将 parent 的缩写符号用于 key 函数的 use 属性,至少对于我的设置。

这不起作用

<xsl:key name="eventsSuppressedByTheSameEventKey" match="suppressedMonitor" use="../suppressingMonitor/@event" />

但这确实有效

<xsl:key name="eventsSuppressedByTheSameEventKey" match="suppressedMonitor" use="parent::suppressingMonitor/@event" />
为什么?出于某种原因,use 属性内是否不支持缩写符号?

最佳答案

缩写:

parent::suppressingMonitor/@event

是:

../@event

不是:

../suppressingMonitor/@event

关于XSLT/Xpath : Why is it not possible to use the shortened notation for parent for the use attribute of the key function,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61463881/

相关文章:

visual-studio - 如何更改 XSLT 调试器的输入文件?

xml - 我的 XSLT 中有什么错误?

xml - xslt 1.0 中的拆分函数

XPath 查询 : select only node with unique child

javascript - 使用 Casper.js 单击按钮

c# - 在 C# 中从 XML 数据库字符串获取 XML 值

xml - XSL - 替换其他结构中同名的节点值

xml - 在浏览器外部以编程方式应用 XSL 转换

python - 使用 lxml 和路径解析 xml,但如果它有 xmlns 声明,则得到空列表

javascript - 我想在 javascript 或 Jquery 中使用 XPath 3.0 语言支持