PyXdmValue¶
- class PyXdmValue¶
Bases:
objectA 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,PyXdmMaporPyXdmArray. If the item does not exist, return None.- Return type:
- __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:
- 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: