In article < >,
Edwin G. Castro <> wrote:
>I'd like to determine if an attribute exists and do some action if it
>does. Otherwise, I want to take some other action or simply do
>nothing.
Use an XPath that matches the attribute in a test, or that matches an
element that has the attribute in a template.
For example, if you have templates
<xsl:template select="foo[@bar]"> ...
and
<xsl:template select="foo"> ...
the first will match <foo>s that have a bar attribute, and the second
will match the others. Or you could use a conditional:
<xsl:choose>
<xsl:when test="@bar">
...
</xsl:when>
<xsl

therwise>
...
</xsl

therwise>
</xsl:choose>
-- Richard