如何将xmlns:*属性与XSLT匹配? [英] How can I match the xmlns:* attributes with XSLT?

查看:114
本文介绍了如何将xmlns:*属性与XSLT匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将 xmlns:* 属性与XSLT 1.0匹配?我尝试使用RDF文档:

How can I match the xmlns:* attributes with XSLT 1.0 ? Using a RDF document I tried:

<xs:template match="rdf:RDF">
(...)
<xsl:for-each select="@*">
  <xsl:value-of select="."/>
</xsl:for-each>
(...)
</xsl:template>

,但对于 xmlns 属性似乎不起作用.

but it doesn't seem to work for the xmlns attributes.

谢谢.

推荐答案

xmlns属性不是普通属性,它们是名称空间声明.您需要使用名称空间轴来访问它们.

The xmlns attributes aren't normal attributes, they are namespace declarations. You need to use the namespace axis to access them.

例如:

<xsl:for-each select="namespace::*">
   <xsl:value-of select="name()" />
</xsl:for-each>

这篇关于如何将xmlns:*属性与XSLT匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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