In article <d9**************************@posting.google.com >,
Edwin G. Castro <ec*****@hp.com> 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:otherwise>
...
</xsl:otherwise>
</xsl:choose>
-- Richard