Modules | Implementer Page: func.function.html Element Syntax<func:function name = QName> <-- Content: (xsl:param* | template) --> </func:function>
The
The EXSLT - Functions namespace (
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.
If a stylesheet contains more than one
When an extension function defined with Defining Function Arguments
Arguments for functions are defined with the
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: <func:function name="my:func"> <xsl:param name="foo" /> <xsl:param name="bar" select="false()" /> ... </func: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 The type of the value passed into the function may be tested with the exsl:object-type function if it is supported. Function Results
The content of the
It is an error if the instantiation of the template results in the generation of result nodes. For example a call to <func:function name="my:func"> <foo /> </func:function>
The instantiation of the content of the
If no Implementations
The following XSLT processors support
There are currently no third-party implementations of ExamplesFunction
This use case tests the result of a function that involves a Source<doc> <section index="section1" index2="atr2val"> <section index="subSection1.1"> <p>Hello</p> <p>Hello again.</p> </section> </section> <section index="section2"> <p>Hello2</p> <section index="subSection2.1"> <p>Hello</p> <p>Hello again.</p> </section> <section index="subSection2.2"> <p>Hello</p> <p>Hello again.</p> </section> <p>Hello2 again.</p> <section index="subSection2.3"> <p>Hello</p> <p>Hello again.</p> </section> </section> </doc> Stylesheet<func:function name="my:count-elements"> <xsl:for-each select="(//*)[1]"> <func:result select="count(//*)" /> </xsl:for-each> </func:function> <xsl:template match="/"> <out> <xsl:value-of select="my:count-elements()" /> </out> </xsl:template> Result<out xmlns:my="my://own.uri">17</out> |
http://www.exslt.org/func/elements/function/index.html last modified 2002-11-12