Re: [xsl] value-of or apply-templates: What is "best"?

Subject: Re: [xsl] value-of or apply-templates: What is "best"?
From: "J. S. Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Thu, 31 May 2007 09:21:52 +0530
I think below examples are self explanatory.

xsl:apply-templates: defines a set of nodes to be processed, and causes the system to process them by selecting an appropriate template
Example: <para>xxxxx<b>bold text</b>xxxx</para>
<xsl:template match="para">
<p><xsl:apply templates/></p>
</xsl:templates>
Result: <p>xxxxx<b>bold text</b>xxxx</p>


xsl:value-of: writes the string value of an expression to the result tree.
<xsl:template match="para">
<p><xsl:value-of select="."></p>
</xsl:templates>
Result: <p>xxxxxbold textxxxx</p>

Current Thread