PyXdmValue

class PyXdmValue

Bases: object

A PyXdmValue represents a value in the XDM data model. A value is a sequence of zero or more items, each item being an atomic value, a node, or a function item.

PyXdmValue has no public constructor. All PyXdmValues are created by other API methods.

__getitem__()

Implement the built-in subscript operator (i.e. square brackets []) to return the ith item in the sequence

Returns:

The item at the specified index. This could be a PyXdmItem or any of its subclasses: PyXdmAtomicValue, PyXdmNode, PyXdmFunctionItem, PyXdmMap or PyXdmArray. If the item does not exist, return None.

Return type:

PyXdmItem

__iter__()

Returns the Iterator object of PyXdmValue

add_xdm_item(value)

Add an item to the XDM sequence

Parameters:

value (PyXdmItem) – The PyXdmItem object to add to the sequence

head

Property to get the first item in the sequence

Returns:

The first item or None if the sequence is empty

Return type:

PyXdmItem

item_at(index)

Get the n’th item in the sequence, counting from zero.

Parameters:

index (int) – the index of the item required, counting from zero

Returns:

The item at the specified index. This could be a PyXdmItem or any of its subclasses: PyXdmAtomicValue, PyXdmNode, PyXdmFunctionItem, PyXdmMap or PyXdmArray. If the item does not exist returns None.

Return type:

PyXdmItem

size

Get the number of items in the sequence

Returns:

The count of items in the sequence

Return type:

int

class PyXdmValueIterator

Bases: object

Iterator class for PyXdmValue

__iter__()

Implement iter(self).

__next__()

Returns the next value from PyXdmValue object’s lists