Representation of attributes on an XML node.
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.
Public Member Functions | |
| def | add |
| def | clear |
| def | clone |
| def | getIndex |
| def | getLength |
| def | getName |
| def | getNumAttributes |
| def | getPrefix |
| def | getPrefixedName |
| def | getURI |
| def | getValue |
| def | hasAttribute |
| def | isEmpty |
| def | remove |
| def | removeResource |
| def libsbml.XMLAttributes.add | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
add(string name, string value, string namespaceURI = "",
string prefix = "")
int
add(string name, string value, string namespaceURI = "")
int
add(string name, string value)
int
add(XMLTriple triple, string value)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
add( XMLTriple triple, string value)
Adds an attribute with the given XMLTriple/value pair to this XMLAttributes set.
| triple | an XMLTriple, the XML triple of the attribute. | |
| value | a string, the value of the attribute. |
add( string name , string value , string namespaceURI = '' , string prefix = '')
Adds an attribute (a name/value pair) to this XMLAttributes object, optionally with a prefix and URI defining a namespace.
| name | a string, the local name of the attribute. | |
| value | a string, the value of the attribute. | |
| namespaceURI | a string, the namespace URI of the attribute. | |
| prefix | a string, the prefix of the namespace |
| def libsbml.XMLAttributes.clear | ( | self | ) |
Python method signature(s):
clear()int
Clears (deletes) all attributes in this XMLAttributes object.
| def libsbml.XMLAttributes.clone | ( | self | ) |
Python method signature(s):
clone()XMLAttributes
Creates and returns a deep copy of this XMLAttributes set.
| def libsbml.XMLAttributes.getIndex | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getIndex(string name)int getIndex(string name, string uri)
int getIndex(XMLTriple triple)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
getIndex(XMLTriple triple)
Return the index of an attribute with the given XMLTriple.
| triple | an XMLTriple, the XML triple of the attribute for which the index is required. |
getIndex(string name, string uri)
Return the index of an attribute with the given local name and namespace URI.
| name | a string, the local name of the attribute. | |
| uri | a string, the namespace URI of the attribute. |
getIndex(string name)
Return the index of an attribute with the given name.
| name | a string, the local name of the attribute for which the index is required. |
| def libsbml.XMLAttributes.getLength | ( | self | ) |
Python method signature(s):
getLength()int
Return the number of attributes in the set.
| def libsbml.XMLAttributes.getName | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getName(int index)string
Return the local name of an attribute in this XMLAttributes set (by position).
| index | an integer, the position of the attribute whose local name is required. |
| def libsbml.XMLAttributes.getNumAttributes | ( | self | ) |
Python method signature(s):
getNumAttributes()int
Return the number of attributes in the set.
This function is an alias for getLength introduced for consistency with other XML classes.
| def libsbml.XMLAttributes.getPrefix | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getPrefix(int index)string
Return the prefix of an attribute in this XMLAttributes set (by position).
| index | an integer, the position of the attribute whose prefix is required. |
| def libsbml.XMLAttributes.getPrefixedName | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getPrefixedName(int index)string
Return the prefixed name of an attribute in this XMLAttributes set (by position).
| index | an integer, the position of the attribute whose prefixed name is required. |
| def libsbml.XMLAttributes.getURI | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getURI(int index)string
Return the namespace URI of an attribute in this XMLAttributes set (by position).
| index | an integer, the position of the attribute whose namespace URI is required. |
| def libsbml.XMLAttributes.getValue | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
getValue(int index)string getValue(string name)
string getValue(string name, string uri)
string getValue(XMLTriple triple)
string
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
getValue(XMLTriple triple)
Return a value of an attribute with the given XMLTriple.
| triple | an XMLTriple, the XML triple of the attribute whose value is required. |
getValue(int index)
Return the value of an attribute in this XMLAttributes set (by position).
| index | an integer, the position of the attribute whose value is required. |
getValue(string name)
Return an attribute's value by name.
| name | a string, the local name of the attribute whose value is required. |
getValue(string name, string uri)
Return a value of an attribute with the given local name and namespace URI.
| name | a string, the local name of the attribute whose value is required. | |
| uri | a string, the namespace URI of the attribute. |
| def libsbml.XMLAttributes.hasAttribute | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
hasAttribute(int index)bool hasAttribute(string name, string uri = "")
bool hasAttribute(string name)
bool hasAttribute(XMLTriple triple)
bool
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
hasAttribute(XMLTriple triple)
Predicate returning true or false depending on whether an attribute with the given XML triple exists in this XMLAttributes.
| triple | an XMLTriple, the XML triple of the attribute |
true if an attribute with the given XML triple exists in this XMLAttributes, false otherwise.hasAttribute(int index)
Predicate returning true or false depending on whether an attribute with the given index exists in this XMLAttributes.
| index | an integer, the position of the attribute. |
true if an attribute with the given index exists in this XMLAttributes, false otherwise.hasAttribute(string name, string uri='')
Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes.
| name | a string, the local name of the attribute. | |
| uri | a string, the namespace URI of the attribute. |
true if an attribute with the given local name and namespace URI exists in this XMLAttributes, false otherwise. | def libsbml.XMLAttributes.isEmpty | ( | self | ) |
Python method signature(s):
isEmpty()bool
Predicate returning true or false depending on whether this XMLAttributes set is empty.
true if this XMLAttributes set is empty, false otherwise. | def libsbml.XMLAttributes.remove | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
remove(int n)int remove(string name, string uri = "")
int remove(string name)
int remove(XMLTriple triple)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
remove(XMLTriple triple)
Removes an attribute with the given XMLTriple from this XMLAttributes set.
| triple | an XMLTriple, the XML triple of the attribute. |
remove(int n)
Removes an attribute with the given index from this XMLAttributes set. (This function is an alias of XMLAttributes.removeResource() ).
| n | an integer the index of the resource to be deleted |
remove(string name, string uri = '')
Removes an attribute with the given local name and namespace URI from this XMLAttributes set.
| name | a string, the local name of the attribute. | |
| uri | a string, the namespace URI of the attribute. |
| def libsbml.XMLAttributes.removeResource | ( | self, | ||
| args | ||||
| ) |
Python method signature(s):
removeResource(int n)int
Removes an attribute with the given index from this XMLAttributes set.
| n | an integer the index of the resource to be deleted |