Let's take a look at an example:
<Xsl: call-template name = "footer"> <xsl: with-param name = "date" select = "@ lastupdate"/> </xsl: call-template>
<Xsl: template name = "footer"> <xsl: param name = "date"> today </xsl: param> For an xml template, the name attribute is critical. The name of the call-template/apply-template must be the same as the name of the template.
Correspondingly. The template is equivalent to a function, which can be viewed for the moment. The name is equivalent to the function name.
Using xsl: with-param in call-template is equivalent to function parameter input.
The parameter declaration is equivalent to the xsl: param of xsl: template.
Speaking of xsl: variable.
<Xsl: variable name = "ShowDepth"> <calculated value> </xsl: variable> can be used to declare
It is equivalent to const in c, because the variable cannot be changed once declared.
For xsl: param and xsl: variable, you can use $ + name to directly select
<Xsl: value-of select = "$ date"/> is to select the date variable or parameter.
Variables and parameters are declared in the same scope as those in the language.
Finally, the most important thing is that the variable of xsl cannot be changed any more.
Do not be confused by its name,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.