PyXdmArray

class PyXdmArray

Bases: PyXdmFunctionItem

The class PyXdmArray represents an array in the XDM data model. An array is a list of zero or more members, each of which is an arbitrary XDM value. The array itself is an XDM item. A PyXdmArray is immutable.

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

__iter__(self)

Returns the Iterator object of PyXdmArray

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

Helper for pickle.

__repr__()

Return repr(self).

__setstate__()
__str__()

Return str(self).

add_member(self, value)

Append a new member to an array. :param value: the new member :type value: PyXdmValue

Returns:

a new array, one item longer than the original

Return type:

PyXdmArray

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

array_length

Get the number of members in the array :returns: the number of members in the array. (Note that the size() method returns 1 (one),

because an XDM array is an item.)

Return type:

int

as_list(self)

Get the members of the array in the form of a list. :returns: list of the members of this array :rtype: list

concat(self, PyXdmArray value)

Concatenate another array to this array :param value: the other array :type value: PyXdmArray

Returns:

a new array, containing the members of this array followed by the members of the other array

Return type:

PyXdmArray

get(self, int n)

Get the n’th member in the array, counting from zero :param n: the member that is required, counting the first member in the array as member zero :type n: int

Returns:

the n’th member in the sequence making up the array, counting from zero

Return type:

PyXdmValue

put(self, int n, PyXdmValue value)

Create a new array in which one member is replaced with a new value. :param n: n the position of the member that is to be replaced, counting the first member

in the array as member zero

Parameters:

value (PyXdmValue) – the new value for this member

Returns:

a new array, the same length as the original, with one member replaced by a new value

Return type:

PyXdmArray

string_value

Property to get the string value of the PyXdmArray :returns: String value of the array item :rtype: str