An attribute set is a fixed set of attributes which I don't believe have any concept of context.
A similar concept might be accomplished by either using a named template or template modes:
Code:
<xsl:template match="/root">
<xsl:for-each>
<xsl:element name="newElement">
<xsl:call-template name="defaultAttributes"/>
<xsl:value-of select="."/>
</xsl:element>
</xsl:for-each>
</xsl:template>
<xsl:template name="defaultAttributes">
<xsl:attribute name="theName"><xsl:value-of select="name()"/></xsl:attribute>
</xsl:template>
However, if you are only doing the one attribute then this might be a much quicker way of doing it:
Code:
<xsl:template match="/root">
<xsl:for-each>
<newElement theName="{name()}">
<xsl:value-of select="."/>
</newElement>
</xsl:for-each>
</xsl:template>
/- Sam Judson : Wrox Technical Editor -/