pugixml.pugi.XPathVariable
- class pugixml.pugi.XPathVariable
Bases:
pybind11_objectA single XPath variable.
See also
Methods
__init__(*args, **kwargs)get_boolean(self)Return the variable value without type conversion.
get_node_set(self)Return the variable value without type conversion.
get_number(self)Return the variable value without type conversion.
get_string(self)Return the variable value without type conversion.
name(self)Return the variable name.
set(*args, **kwargs)Overloaded function.
type(self)Return the variable type.
Member Documentation
- __init__(*args, **kwargs)
- get_boolean(self: pugixml.pugi.XPathVariable) bool
Return the variable value without type conversion.
- Returns:
The variable value, or
Falseif variable type does not match.
- get_node_set(self: pugixml.pugi.XPathVariable) pugixml.pugi.XPathNodeSet
Return the variable value without type conversion.
- Returns:
The variable value, or empty node set if variable type does not match.
- get_number(self: pugixml.pugi.XPathVariable) float
Return the variable value without type conversion.
- Returns:
The variable value, or
float('nan')if variable type does not match.
- get_string(self: pugixml.pugi.XPathVariable) str
Return the variable value without type conversion.
- Returns:
The variable value, or an empty string if variable type does not match.
- name(self: pugixml.pugi.XPathVariable) str
Return the variable name.
- Returns:
The variable name.
- set(*args, **kwargs)
Overloaded function.
set(self: pugixml.pugi.XPathVariable, value: typing.SupportsFloat | typing.SupportsIndex) -> bool
set(self: pugixml.pugi.XPathVariable, value: bool) -> bool
Set the variable value as a boolean.
set(self: pugixml.pugi.XPathVariable, value: str) -> bool
Set the variable value as a string.
set(self: pugixml.pugi.XPathVariable, value: pugixml.pugi.XPathNodeSet) -> bool
Set the variable value as the XPath node set.
- Parameters:
value – The variable value to set.
- Returns:
Falseif variable type does not match or there is not enough memory.
- type(self: pugixml.pugi.XPathVariable) pugixml.pugi.XPathValueType
Return the variable type.
- Returns:
The variable type.