PyXdmFunctionItem

class PyXdmFunctionItem

Bases: PyXdmItem

The class PyXdmFunctionItem represents a function item

Creates a new instance, keeping a reference to its PySaxonProcessor :param processor:

classmethod __new__(*args, **kwargs)
__pyx_vtable__ = <capsule object NULL>
__reduce__()

Helper for pickle.

__repr__()

Return repr(self).

__setstate__()
__str__()

Return str(self).

arity

Get the arity of the function :returns: The arity of the function, that is, the number of arguments in the function’s signature :rtype: int

call(self, list args)

Call the function :param args: the values to be supplied as arguments to the function. The “function

conversion rules” will be applied to convert the arguments to the required type when necessary.

Returns:

the result of calling the function

Return type:

PyXdmValue

static get_system_function(self, PySaxonProcessor proc, str name, arity, encoding=None)

Get a system function. This can be any function defined in XPath 3.1 functions and operators, including functions in the math, map, and array namespaces. It can also be a Saxon extension function, provided a licensed Processor is used. :param proc: the Saxon processor :type proc: PySaxonProcessor :param name: the name of the requested function as an EQName or clark name :type name: str :param arity: the arity of the requested function :type arity: int :param encoding: the encoding of the name string. If not specified then the platform default encoding is used. :type encoding: str

Returns:

the requested function

Return type:

PyXdmFunctionItem

name

Get the name of the function :returns: The name of the function as an EQName :rtype: str

string_value

Property to get the string value of the PyXdmFunctionItem. This will always raise an Exception, as function items have no representation as a string value (FOTY0014). :raises PySaxonApiError: function items have no representation as a string value