pugixml.pugi.XPathVariableSet
- class pugixml.pugi.XPathVariableSet
Bases:
pybind11_objectA set of XPath variables.
See also
Methods
__init__(self)Initialize
XPathVariableSet.add(self, name, value_type)Add a new variable and return it, or return the existing one if the types match.
get(self, name)Return the existing variable with the specified name.
set(*args, **kwargs)Overloaded function.
Member Documentation
- __init__(self: pugixml.pugi.XPathVariableSet) None
Initialize
XPathVariableSet.
- add(self: pugixml.pugi.XPathVariableSet, name: str, value_type: pugixml.pugi.XPathValueType) pugixml.pugi.XPathVariable | None
Add a new variable and return it, or return the existing one if the types match.
- Parameters:
name – The variable name to add/get.
value_type – The variable type to add/get.
- Returns:
The variable added or the existing one if the types matches, or
Noneif nothing exists or there is not enough memory.
- get(self: pugixml.pugi.XPathVariableSet, name: str) pugixml.pugi.XPathVariable | None
Return the existing variable with the specified name.
- Parameters:
name – The variable name to get.
- Returns:
The variable if exists,
Noneotherwise.
- set(*args, **kwargs)
Overloaded function.
set(self: pugixml.pugi.XPathVariableSet, name: str, value: typing.SupportsFloat | typing.SupportsIndex) -> bool
set(self: pugixml.pugi.XPathVariableSet, name: str, value: bool) -> bool
Set the value of an existing variable as a boolean.
No type conversion is performed.
set(self: pugixml.pugi.XPathVariableSet, name: str, value: str) -> bool
Set the value of an existing variable as a string.
No type conversion is performed.
set(self: pugixml.pugi.XPathVariableSet, name: str, value: pugixml.pugi.XPathNodeSet) -> bool
Set the value of an existing variable as the XPath node set.
No type conversion is performed.
These are equivalent to
add(name, value_type).set(value).- Parameters:
name – The variable name to set.
value – The variable value to set.
- Returns:
Falseif there is no such variable or if types mismatch.