एक्सएसएलटी <एक्सएसएल:परम>
❮ पूर्ण एक्सएसएलटी तत्व संदर्भ
परिभाषा और उपयोग
स्थानीय या वैश्विक पैरामीटर घोषित करने के लिए <xsl:param> तत्व का उपयोग किया जाता है।
नोट: पैरामीटर वैश्विक है यदि इसे शीर्ष-स्तरीय तत्व के रूप में घोषित किया गया है, और स्थानीय यदि इसे टेम्पलेट के भीतर घोषित किया गया है।
वाक्य - विन्यास
<xsl:param
name="name"
select="expression">
<!-- Content:template -->
</xsl:param>
गुण
Attribute | Value | Description |
---|---|---|
name | name | Required. Specifies the name of the parameter |
select | expression | Optional. Specifies an XPath expression that specifies a default value for the parameter |
उदाहरण 1
<?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>
<xsl:for-each
select="catalog/cd">
<xsl:call-template name="show_title">
<xsl:with-param name="title" select = "title" />
</xsl:call-template>
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template name = "show_title" >
<xsl:param name = "title"
/>
<p>Title: <xsl:value-of select = "$title" /></p>
</xsl:template>
</xsl:stylesheet>
❮ पूर्ण एक्सएसएलटी तत्व संदर्भ