获取 XML 中的属性值 [英] Getting the value of an attribute in XML
本文介绍了获取 XML 中的属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用 xslt 在以下 xml 中获取 attribute1 (blah) 的值:
How would one get the value of attribute1 (blah) in the following xml using xslt:
<name attribute1="blah" attribute2="blahblah">
</name>
推荐答案
这更像是一个 xpath 问题,但像这样,假设上下文是父元素:
This is more of an xpath question, but like this, assuming the context is the parent element:
<xsl:value-of select="name/@attribute1" />
这篇关于获取 XML 中的属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文