Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想获取文本节点的所有“generateId”值,它们是属性“id”值已知的特定节点的子节点。我可以使用 XSL 测试这种情况吗?
使用这样的 XPath 2.0 表达式:
//specificNode[@id=$knownValue]/text()/generate-id(.)
您还可以使用键(<xsl:key>和key()函数)更有效地选择所有具有idknownValue 属性的特定节点。
<xsl:key>
key()
id