Xslt template param default value


















This will output the value of the first item element, because the variable "n" will be bound to a result tree fragment, not a number. Instead, do either. The following is a convenient way to specify the empty node-set as the default value of a parameter. This example defines a named template for a "numbered-block" with an argument to control the format of the number. Skip to main content. This browser is no longer supported. Collectives on Stack Overflow.

Learn more. How to call template with parameter with default vvalue in xsl file? Ask Question. Asked 9 years, 9 months ago. Active 9 years, 9 months ago. Viewed 3k times. BSalunke BSalunke Add a comment. Active Oldest Votes. Another value can be passed to this parameter when the template or stylesheet that contains this xsl:param instruction is invoked.

The xsl:param element must be a child of either an xsl:stylesheet or xsl:template element. The name attribute is required, and it must be a string. The value of the name attribute is a qualified name.

The value that you bind to a parameter can be an object of any of the types that are returned by expressions. You can specify the value of the parameter in several ways:. The XSLT processor interprets the value of the expr attribute as an attribute value template and uses the resulting string as if it were the value of the select attribute.

If you specify the expr attribute, the XSLT processor ignores any contents of xsl:param. The use of the expr attribute is an extension to the XSLT specification.



0コメント

  • 1000 / 1000