中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

XSLT xsl:apply-templates 元素


<xsl:apply-templates> 元素可把一個(gè)模板應(yīng)用于當(dāng)前的元素或者當(dāng)前元素的子節(jié)點(diǎn)。


<xsl:apply-templates> 元素

<xsl:apply-templates> 元素可向當(dāng)前元素或當(dāng)前元素的子節(jié)點(diǎn)應(yīng)用模板。

如果我們向 <xsl:apply-templates> 元素添加 select 屬性,那么它僅會(huì)處理匹配該屬性的值的子元素。我們可使用 select 屬性來(lái)規(guī)定要處理的子節(jié)點(diǎn)的順序。

請(qǐng)看下面的 XSL 樣式表:

實(shí)例

<?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>