> In fact if you used templates instead of the copy-of, you could generalize
> this for all the attributes:
>
> <input name="default" name2="default2">
> <xsl:apply-templates select="@*"/>
> </input>
>
> <xsl:template match="node/@*">
> <xsl:copy-of select="."/>
> </xsl:template>
>
> <xsl:template match="@gunk" priority="1">
> <xsl:attribute name="name">
> <xsl:value-of select="."/>
> </xsl:attribute>
> </xsl:template>
>
> Note that on the template for the attribute whose name is changing (@gunk
> to @name), an explicit priority is necessary to make sure that template
> fires instead of the template that copies.
Wendell, that's a bit obscure (thus, I like it), but it probably makes sense
where you're doing a lot of attribute manipulation. In particular, if you
changed the name of a certain set of attributes on multiple different
elements. The choose block certainly makes it more obvious what's going on
and I'd guess it's likely is more efficient for the case where you're only
flipping the name on a single attribute for a single element...?
Quite so. Remember the original context was one of copying attribute
values, only giving them defaults if they weren't provided, and then the
poster asked what if he wanted to change an attribute's name as well.... I
was merely extending the logic you had already provided to do the simpler
job with xsl:copy-of -- despite the inference one might draw that here the
technique had to be abandoned for a choose. :->