xml - xpath 表达式 "@*"是什么意思?

标签 xml xslt xpath

Microsoft 在 Visual Studio 上的 XSLT 模板是这样的:

<xsl:template match="@* | node()">

什么是@*

最佳答案

@*attribute::* 的缩写,选择上下文节点的所有属性(或者,在 XSLT 匹配模式中,更恰本地说它匹配所有属性)。来自 the XPath spec :

There is also an abbreviation for attributes: attribute:: can be abbreviated to @. For example, a location path para[@type="warning"] is short for child::para[attribute::type="warning"] and so selects para children with a type attribute with value equal to warning.

关于xml - xpath 表达式 "@*"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9082737/

相关文章:

xml - 使用 saxon xquery 从 xml 中删除元素

java - 安卓错误 "The application may be doing too much work on its main thread"

python-3.x - 在 xpath 语句上设置条件

html - xpath 找到一个包含特定文本的 div 并获取下一个跨度

java - 如何在Spring XML上下文中实现条件资源导入?

c# - C# 对象的前缀和命名空间

xml - 合并两个由 Heat 生成的 .wxs 文件

xslt - 每个路径的xpath多个条件

sharepoint - XSL/XSLT - 添加一个值作为 DIV 的样式属性

scala - 如何使用VTD-XML库在Scala中解析XML文件?