Definition and Usage
¶¨ÒåºÍÓ÷¨
The <xsl:call-template> element calls a named template.
<xsl:call-template> ÔªËØµÄ×÷ÓÃÊÇ£ºÇëÇóÒ»¸öÖ¸¶¨µÄÄ£°æ¡£
Syntax
Óï·¨
<xsl:call-template name="templatename"> <!-- Content:xsl:with-param* --> </xsl:call-template> |
Attributes
ÊôÐÔ
| ÊôÐÔ | Öµ | ÃèÊö |
|---|---|---|
| name | templatename | Required. Specifies the name of the template to be called ±ØÒª²ÎÊý¡£Ö¸¶¨ÇëÇóµÄÄ£°æÃû³Æ |
Example 1
°¸Àý1
Call a template named "description" when the processor finds a car element:
ÔÚ´¦Àí“finds a car[²éÕÒÒ»Á¾Æû³µ]”ÔªËØÊ±£¬ÇëÇóÒ»¸öÃûΪ“description”µÄÄ£°æ£º
<xsl:template match="car"> <xsl:call-template name="description"/> </xsl:template> |