एक्सएसएलटी <xsl: लागू-टेम्पलेट्स> तत्व
<xsl:apply-templates> तत्व वर्तमान तत्व या वर्तमान तत्व के चाइल्ड नोड्स के लिए एक टेम्पलेट नियम लागू करता है।
<xsl:लागू-टेम्पलेट्स> तत्व
<xsl:apply-templates> तत्व वर्तमान तत्व या वर्तमान तत्व के चाइल्ड नोड्स के लिए एक टेम्पलेट लागू करता है।
यदि हम <xsl:apply-templates> तत्व में "चयन" विशेषता जोड़ते हैं, तो यह केवल उन चाइल्ड तत्वों को संसाधित करेगा जो विशेषता के मूल्य से मेल खाते हैं। हम "चयन" विशेषता का उपयोग यह निर्दिष्ट करने के लिए कर सकते हैं कि बच्चे के नोड्स को किस क्रम में संसाधित किया जाना है।
निम्नलिखित एक्सएसएल स्टाइल शीट देखें:
उदाहरण
<?xml version="1.0" encoding="UTF-8"?>
<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>