problem matching attributes (probably trivial)

wxdqz

New Member
The xsl template below transforms the tag <text name="Text Block Name">some text here</text> to a HTML representation.

If the name attribute is missing, I'll get an empty <b></b> string, which does not hurt but I would like to get rid of it.

Question: How should the template below look so that no empty <b></b> string is generated if there is no name attribute?

<xsl:template match="text">
<b>
<xsl:value-of select="attribute::name"/>
</b>
<div style="border-width: 1px; border-style: solid">
<xsl:apply-templates/>
</div>
<br/>
</xsl:template>
 
Back
Top