Example using xsl:value-of and xsl:template
<xsl:template match="cd">
<pre>
<xsl:value-of select="artist"/>: <em><xsl:value-of select="title"/></em>
</pre>
</xsl:template>
- Built-in template used for cdlist
- Only template needed if XML data island in IE6
- Each cd node outputs artist and title
< xsl:value-of select="" />
- Extracts text from the Source Tree and generates a text node to place in the Output Tree
-
select attribute defines the path to the element or attribute value in the Source Tree
- Text node generated concatenates any text before or after the text node
- Each CD node generates output:
<pre>
anartist: <em>atitle</em>
</pre>
Result