XSLT 元素

<xsl:apply-templates> ఎలమెంటు ప్రస్తుత ఎలమెంటు లేదా ప్రస్తుత ఎలమెంటు ఉపమెంటులపై ఒక టేంప్లేటును ఆపాదిస్తుంది.

<xsl:apply-templates> ఎలమెంటు

<xsl:apply-templates> ఎలమెంటు ప్రస్తుత ఎలమెంటు లేదా ప్రస్తుత ఎలమెంటు ఉపమెంటులపై ఒక టేంప్లేటును ఆపాదిస్తుంది.

మేము <xsl:apply-templates> ఎలమెంటుకు ఒక select అంతర్భాగాన్ని చేర్చినప్పుడు, అది ఆ అంతర్భాగంతో మేలుపడే ఉపమెంటులను కేవలం ప్రాసెస్ చేస్తుంది. మేము select అంతర్భాగాన్ని ఉపయోగించి ఉపమెంటులను ప్రాసెస్ చేయే క్రమాన్ని నిర్ణయించవచ్చు.

దిగువన ఉన్న XSL షేప్ ప్రదర్శించండి:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2> 
<xsl:apply-templates/> 
</body>
</html>
</xsl:template>
<xsl:template match="cd">
<p>
<xsl:apply-templates select="title"/> 
<xsl:apply-templates select="artist"/>
</p>
</xsl:template>
<xsl:template match="title">
Title: <span style="color:#ff0000">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
<xsl:template match="artist">
Artist: <span style="color:#00ff00">
<xsl:value-of select="."/></span>
<br />
</xsl:template>
</xsl:stylesheet>

ఈ XML ఫైల్ను చూడండి,ఈ XSL ఫైల్ను చూడండి,ఫలితాలను చూడండి.