PyXdmAtomicValue

class PyXdmAtomicValue

Bases: PyXdmItem

The class PyXdmAtomicValue represents an item in an XPath sequence that is an atomic value. The value may belong to any of the 19 primitive types defined in XML Schema, or to a type derived from these primitive types, or the XPath type xs:untypedAtomic.

boolean_value

Get the boolean value of the PyXdmAtomicValue, converted using the XPath casting rules

Returns:

the result of converting to a boolean

Return type:

bool

double_value

Get the double value of the PyXdmAtomicValue, converted using the XPath casting rules

Returns:

the result of converting to a double

Return type:

double

get_string_value(encoding=None)

Property to get the string value of the atomic value as defined in the XPath data model

Parameters:

encoding (str) – The encoding of the string. If not specified then the platform default encoding is used.

Returns:

The string value of this node

Return type:

str

head

Property to get the first item in the sequence represented by this PyXdmAtomicValue. Since a PyXdmItem is a sequence of length one, this returns the PyXdmAtomicValue itself.

Returns:

The PyXdmAtomicValue or None if the sequence is empty

Return type:

PyXdmAtomicValue

integer_value

Get the integer value of the PyXdmAtomicValue, converted using the XPath casting rules

Returns:

the result of converting to an integer

Return type:

int

primitive_type_name

Get the primitive type name of the PyXdmAtomicValue

Returns:

String of the primitive type name

Return type:

str

string_value

Get the string value of the PyXdmAtomicValue, converted using the XPath casting rules

Returns:

the result of converting to a string

Return type:

str