This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: is there a generic way to iterate through all attributes of a tag.
- From: "Kimberly Hahn" <Kimberly dot Hahn at enform dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 5 Aug 2002 16:38:45 -0500
- Subject: RE: [xsl] is there a generic way to iterate through all attributes of a tag.
- Reply-to: xsl-list at lists dot mulberrytech dot com
You can use @* or attribute::*
ex. <xsl:for-each select="@*">
will loop through all the attributes of the current node.
for what you sound like you are doing, it may be better to call a template
to process attributes -
<xsl:template match="*">
tag: <xsl:value-of select="name()"/>
<xsl:apply-templates select="@*"/>
value: <xsl:value-of select="."/>
</xsl:template>
<xsl:template match="@*">
attribute: <xsl:value-of select="name()"/>
</xsl:template>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list