satellite03
IS-IT--Management
XML
===
<source>
<employee id="js0034"> Joe Smith </employee>
</source>
XSLT
======
<xsl:stylesheet version = '1.0'
xmlns:xsl='<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="."/> --> line 1
</i>
</b>
</xsl:template>
</xsl:stylesheet>
output:
======
Joe Smith
[<b>
<i>js0034</i>
</b>]
question
===========
Look at line 1
<xsl:value-of select tag always gives the value of the element . here the element is the <employee . and its values is "Joe Smith" . so the output should have been "Joe Smith" but i am getting the output as "js0034". why it is like this ?
===
<source>
<employee id="js0034"> Joe Smith </employee>
</source>
XSLT
======
<xsl:stylesheet version = '1.0'
xmlns:xsl='<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="."/> --> line 1
</i>
</b>
</xsl:template>
</xsl:stylesheet>
output:
======
Joe Smith
[<b>
<i>js0034</i>
</b>]
question
===========
Look at line 1
<xsl:value-of select tag always gives the value of the element . here the element is the <employee . and its values is "Joe Smith" . so the output should have been "Joe Smith" but i am getting the output as "js0034". why it is like this ?