Modules | Version: 2 Element Syntax<func:function name = QName> <-- Content: (xsl:param* | template) --> </func:function> Issue:
The
An Note: the rules on resolving qualified names entail that if no prefix is defined, the namespace URI resolves to the null namespace. Thus, it is an error if the qualified name specified does not have a prefix.
It is an error if a stylesheet contains more than one
When an extension function defined with Defining Function Arguments
Arguments for functions are defined with the Issue:
When an extension function is called, the values passed as arguments are assigned to parameters according to the position of the An XSLT processor must not signal an error if an extension function is called with fewer arguments than there are parameters defined for the extension function. It is an error to call a function with more arguments than there are parameters defined for the extension function. An XSLT processor may signal the error; if it does not signal the error, then it must recover by ignoring the extra arguments. As an example, take the following function definition: <exsl:function name="my:func"> <xsl:param name="foo" /> <xsl:param name="bar" select="false()" /> ... </exsl:function> All the following function calls are legal: my:func() my:func('Fred') my:func('Fred', true()) my:func('Fred', 'Barney') The following function call is illegal: my:func('Fred', true(), 'Barney')
The value specified by an Function Results
The content of the
If the instantiation of the template results in the generation of result nodes, then the result of the function is a result tree fragment consisting of those nodes. For example a call to <exsl:function name="my:func"> <foo /> </exsl:function> It is an error if a member of the sequence of nodes created by instantiating the template is an attribute node or a namespace node, since a root node cannot have an attribute node or a namespace node as a child. An XSLT processor may signal the error; if it does not signal the error, it must recover by not adding the attribute node or namespace node. The result tree fragment that is the result of the function may be converted to a node set using the exsl:node-set function, to a string using the string function, or to a number using the number function. Note: Applying the boolean function to the result tree fragment will always evaluate to true.
As discussed earlier in this section, generating result tree fragments only is not sufficient for many functions that involve manipulation of node sets. To enable functions to return node sets (and booleans), the instantiation of the content of the An implementation of this extension element in the EXSLT func namespace must conform to the behaviour described in this document. Change HistorySubmitted: 2001-03-02
CopyrightThis material is in the public domain. |
http://www.exslt.org/func.function.2.html last modified 2001-03-10