If you only want the attribute 'id' to appear if its value is not an empty string then you can use
or
:
Code:
<xsl:template match="tag">
<newtag>
<xsl:if test="@attribute != ''">
<xsl:attribute name="id">
<xsl:value-of select="@attribute"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</newtag>
</xsl:template>
is for when you need more than two options, where in traditional languages you would use an if then else if or a switch (C/JavaScript) or select (
VB) statement.
--
Joe