XSLT <apply-templates>
<xsl:apply-templates> elementi shablon qoidasini joriy elementga yoki joriy elementning bola tugunlariga qo‘llaydi.
<xsl:apply-templates> elementi
<xsl:apply-templates> elementi shablonni joriy elementga yoki joriy elementning bola tugunlariga qo‘llaydi.
Agar <xsl:apply-templates> elementiga "select" atributini qo‘shsak, u faqat atribut qiymatiga mos keladigan bola elementlarni qayta ishlaydi. "select" atributi yordamida bola tugunlar qaysi tartibda qayta ishlanishini belgilashimiz mumkin.
Quyidagi XSL uslublar jadvaliga qarang:
Misol
<?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>
O‘zingiz sinab ko‘ring »
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
