PyXdmItem¶
- class PyXdmItem¶
Bases:
PyXdmValueThe class PyXdmItem represents an item in a sequence, as defined by the XDM data model. An item is either an atomic value, a node, or a function item.
- get_array_value()¶
Get the subclass PyXdmArray for this current PyXdmItem object if it is an array item
- Returns:
Subclass this object to PyXdmArray or error
- Return type:
- get_atomic_value()¶
Get the subclass PyXdmAtomicValue for this current PyXdmItem object if it is an atomic value
- Returns:
Subclass this object to PyXdmAtomicValue or error
- Return type:
- get_function_value()¶
Get the subclass PyXdmFunctionItem for this current PyXdmItem object if it is a function item
- Returns:
Subclass this object to PyXdmFunctionItem or error
- Return type:
- get_map_value()¶
Get the subclass PyXdmMap for this current PyXdmItem object if it is a map item
- Returns:
Subclass this object to PyXdmMap or error
- Return type:
- get_node_value()¶
Get the subclass PyXdmNode for this current PyXdmItem object if it is a node
- Returns:
Subclass this object to PyXdmNode or error
- Return type:
- get_string_value(encoding=None)¶
Property to get the string value of the item as defined in the XPath data model
- head¶
Property to get the first item in the sequence represented by this PyXdmItem. Since a PyXdmItem is a sequence of length one, this returns the PyXdmItem itself.
- Returns:
The PyXdmItem or None if the sequence is empty
- Return type:
- is_array¶
Property to check if the current PyXdmItem is an array item
- Returns:
True if the current item is an array item
- Return type:
- is_atomic¶
Property to check if the current PyXdmItem is an atomic value
- Returns:
True if the current item is an atomic value
- Return type:
- is_function¶
Property to check if the current PyXdmItem is a function item
- Returns:
True if the current item is a function item
- Return type:
- is_map¶
Property to check if the current PyXdmItem is a map item
- Returns:
True if the current item is a map item
- Return type:
- is_node¶
Property to check if the current PyXdmItem is a node
- Returns:
True if the current item is a node
- 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:
- string_value¶
Property to get the string value of the PyXdmItem