Nic Miloslav     Example 12    KEYWORDS      EXAMPLES      AUTHORS     

You can process an attribute in the same way as an element


     XML     HOME     XSL 1      
<xslTutorial >
<employee id="js0034">
Joe Smith
</employee>
</xslTutorial>

     XSL 1     HOME     XML     HTML 1     OUTPUT 1     
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:template match="employee">
<xsl:value-of select="."/>
<xsl:text> [</xsl:text>
<xsl:apply-templates select="@id"/>
<xsl:text> ]</xsl:text>
</xsl:template>
<xsl:template match="@id">
<B><i><xsl:value-of select="."/></i></B>
</xsl:template>
</xsl:stylesheet>

     HTML 1     HOME     XML     XSL 1     OUTPUT 1     
<HTML>
<HEAD> </HEAD>
<BODY> Joe Smith [
<B>
<i>js0034</i></B>] </BODY> </HTML>

     OUTPUT 1     HOME     XML     XSL 1     HTML 1     
Joe Smith [js0034]