XSL 显示属性名称 [英] XSL show attribute name

查看:22
本文介绍了XSL 显示属性名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,使用那个

<xsl:for-each select="./@*">
   [<xsl:value-of/><xsl:value-of select="."/>]
</xsl:for-each>

我可以迭代属性值.但我也想查看属性名称.

I can iterate over attribute values. But I want to see attribute names too.

我想看一张桌子:属性 1 - 值 1attr2 - val2attr3 - val3...

I want see a table: attr1 - val1 attr2 - val2 attr3 - val3 ...

感谢您的帮助!

推荐答案

您可以使用 name()local-name():

You can do that using name() or local-name():

<xsl:for-each select="./@*">
    [<xsl:value-of select="name()"/><xsl:value-of select="."/>]
</xsl:for-each>

这篇关于XSL 显示属性名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆