libSBML Python API
5.8.0
|
Representation of a token in an XML stream.
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 | addAttr |
def | addNamespace |
def | append |
def | clearAttributes |
def | clearNamespaces |
def | clone |
def | getAttributes |
def | getAttributesLength |
def | getAttrIndex |
def | getAttrName |
def | getAttrPrefix |
def | getAttrPrefixedName |
def | getAttrURI |
def | getAttrValue |
def | getCharacters |
def | getColumn |
def | getLine |
def | getName |
def | getNamespaceIndex |
def | getNamespaceIndexByPrefix |
def | getNamespacePrefix |
def | getNamespaces |
def | getNamespacesLength |
def | getNamespaceURI |
def | getPrefix |
def | getURI |
def | hasAttr |
def | hasNamespaceNS |
def | hasNamespacePrefix |
def | hasNamespaceURI |
def | isAttributesEmpty |
def | isElement |
def | isEnd |
def | isEndFor |
def | isEOF |
def | isNamespacesEmpty |
def | isStart |
def | isText |
def | removeAttr |
def | removeNamespace |
def | setAttributes |
def | setEnd |
def | setEOF |
def | setNamespaces |
def | setTriple |
def | toString |
def | unsetEnd |
def libsbml.XMLToken.addAttr | ( | self, | |
args | |||
) |
Python method signature(s):
addAttr(XMLToken self, string name, string value, string namespaceURI="", string prefix="")int addAttr(XMLToken self, string name, string value, string namespaceURI="")
int addAttr(XMLToken self, string name, string value)
int addAttr(XMLToken self, XMLTriple triple, string value)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
Method variant with the following signature:
addAttr( XMLTriple triple, string value)
Adds an attribute with the given XMLTriple/value pair to the attribute set in this XMLToken. Nothing will be done if this XMLToken is not a start element.
triple | an XMLTriple, the XML triple of the attribute. |
value | a string, the value of the attribute. |
addAttr( string name , string value , string namespaceURI = '' , string prefix = '')
Adds an attribute to the attribute set in this XMLToken optionally with a prefix and URI defining a namespace. Nothing will be done if this XMLToken is not a start element.
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.XMLToken.addNamespace | ( | self, | |
args | |||
) |
Python method signature(s):
addNamespace(XMLToken self, string uri, string prefix="")int addNamespace(XMLToken self, string uri)
int
Appends an XML namespace prefix and URI pair to this XMLToken. If there is an XML namespace with the given prefix in this XMLToken, then the existing XML namespace will be overwritten by the new one.
Nothing will be done if this XMLToken is not a start element.
uri | a string, the uri for the namespace |
prefix | a string, the prefix for the namespace |
def libsbml.XMLToken.append | ( | self, | |
args | |||
) |
Python method signature(s):
append(XMLToken self, string chars)int
Appends characters to this XML text content.
chars | string, characters to append |
def libsbml.XMLToken.clearAttributes | ( | self | ) |
def libsbml.XMLToken.clearNamespaces | ( | self | ) |
Python method signature(s):
clearNamespaces(XMLToken self)int
Clears (deletes) all XML namespace declarations in the XMLNamespaces of this XMLToken. Nothing will be done if this XMLToken is not a start element.
def libsbml.XMLToken.clone | ( | self | ) |
Representation of a token in an XML stream.
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.
Python method signature(s):clone(XMLToken self)XMLToken
Creates and returns a deep copy of this XMLToken.
def libsbml.XMLToken.getAttributes | ( | self | ) |
Python method signature(s):
getAttributes(XMLToken self)XMLAttributes
Returns the attributes of this element.
def libsbml.XMLToken.getAttributesLength | ( | self | ) |
def libsbml.XMLToken.getAttrIndex | ( | self, | |
args | |||
) |
Python method signature(s):
getAttrIndex(XMLToken self, string name, string uri="")int getAttrIndex(XMLToken self, string name)
int getAttrIndex(XMLToken self, XMLTriple triple)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
Method variant with the following signature:
getAttrIndex(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. |
-1
if not present.Method variant with the following signature:
getAttrIndex(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. |
-1
if not present.def libsbml.XMLToken.getAttrName | ( | self, | |
args | |||
) |
Python method signature(s):
getAttrName(XMLToken self, int index)string
Return the local name of an attribute in the attributes set in this XMLToken (by position).
index | an integer, the position of the attribute whose local name is required. |
def libsbml.XMLToken.getAttrPrefix | ( | self, | |
args | |||
) |
Python method signature(s):
getAttrPrefix(XMLToken self, int index)string
Return the prefix of an attribute in the attribute set in this XMLToken (by position).
index | an integer, the position of the attribute whose prefix is required. |
def libsbml.XMLToken.getAttrPrefixedName | ( | self, | |
args | |||
) |
Python method signature(s):
getAttrPrefixedName(XMLToken self, int index)string
Return the prefixed name of an attribute in the attribute set in this XMLToken (by position).
index | an integer, the position of the attribute whose prefixed name is required. |
def libsbml.XMLToken.getAttrURI | ( | self, | |
args | |||
) |
Python method signature(s):
getAttrURI(XMLToken self, int index)string
Return the namespace URI of an attribute in the attribute set in this XMLToken (by position).
index | an integer, the position of the attribute whose namespace URI is required. |
def libsbml.XMLToken.getAttrValue | ( | self, | |
args | |||
) |
Python method signature(s):
getAttrValue(XMLToken self, int index)string getAttrValue(XMLToken self, string name, string uri="")
string getAttrValue(XMLToken self, string name)
string getAttrValue(XMLToken self, XMLTriple triple)
string
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
Method variant with the following signature:
getAttrValue(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. |
Method variant with the following signature:
getAttrValue(int index)
Return the value of an attribute in the attribute set in this XMLToken (by position).
index | an integer, the position of the attribute whose value is required. |
Method variant with the following signature:
getAttrValue(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.XMLToken.getCharacters | ( | self | ) |
Python method signature(s):
getCharacters(XMLToken self)string
Returns the text of this element.
def libsbml.XMLToken.getColumn | ( | self | ) |
def libsbml.XMLToken.getLine | ( | self | ) |
def libsbml.XMLToken.getName | ( | self | ) |
Python method signature(s):
getName(XMLToken self)string
Returns the (unqualified) name of this XML element.
def libsbml.XMLToken.getNamespaceIndex | ( | self, | |
args | |||
) |
Python method signature(s):
getNamespaceIndex(XMLToken self, string uri)int
Look up the index of an XML namespace declaration by URI.
uri | a string, uri of the required namespace. |
-1
if not present. def libsbml.XMLToken.getNamespaceIndexByPrefix | ( | self, | |
args | |||
) |
Python method signature(s):
getNamespaceIndexByPrefix(XMLToken self, string prefix)int
Look up the index of an XML namespace declaration by prefix.
prefix | a string, prefix of the required namespace. |
-1
if not present. def libsbml.XMLToken.getNamespacePrefix | ( | self, | |
args | |||
) |
Python method signature(s):
getNamespacePrefix(XMLToken self, int index)string getNamespacePrefix(XMLToken self, string uri)
string
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
Method variant with the following signature:
getNamespacePrefix(int index)
Look up the prefix of an XML namespace declaration by position.
Callers should use getNamespacesLength() to find out how many namespaces are stored in the XMLNamespaces.
index | an integer, position of the required prefix. |
Method variant with the following signature:
getNamespacePrefix(string uri)
Look up the prefix of an XML namespace declaration by its URI.
uri | a string, the URI of the prefix being sought |
uri
does not exist, an empty string will be returned. def libsbml.XMLToken.getNamespaces | ( | self | ) |
Python method signature(s):
getNamespaces(XMLToken self)XMLNamespaces
Returns the XML namespace declarations for this XML element.
def libsbml.XMLToken.getNamespacesLength | ( | self | ) |
Python method signature(s):
getNamespacesLength(XMLToken self)int
Returns the number of XML namespaces stored in the XMLNamespaces of this XMLToken.
def libsbml.XMLToken.getNamespaceURI | ( | self, | |
args | |||
) |
Python method signature(s):
getNamespaceURI(XMLToken self, int index)string getNamespaceURI(XMLToken self, string prefix="")
string getNamespaceURI(XMLToken self)
string
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
Method variant with the following signature:
getNamespaceURI(int index)
Look up the URI of an XML namespace declaration by its position.
index | an integer, position of the required URI. |
index
is out of range, an empty string will be returned.Method variant with the following signature:
getNamespaceURI(string prefix = '')
Look up the URI of an XML namespace declaration by its prefix.
prefix | a string, the prefix of the required URI |
prefix
does not exist, an empty string will be returned.def libsbml.XMLToken.getPrefix | ( | self | ) |
Python method signature(s):
getPrefix(XMLToken self)string
Returns the namespace prefix of this XML element.
def libsbml.XMLToken.getURI | ( | self | ) |
Python method signature(s):
getURI(XMLToken self)string
Returns the namespace URI of this XML element.
def libsbml.XMLToken.hasAttr | ( | self, | |
args | |||
) |
Python method signature(s):
hasAttr(XMLToken self, int index)bool hasAttr(XMLToken self, string name, string uri="")
bool hasAttr(XMLToken self, string name)
bool hasAttr(XMLToken self, XMLTriple triple)
bool
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
Method variant with the following signature:
hasAttr(XMLTriple triple)
Predicate returning True
or False
depending on whether an attribute with the given XML triple exists in the attribute set in this XMLToken
triple | an XMLTriple, the XML triple of the attribute |
True
if an attribute with the given XML triple exists in the attribute set in this XMLToken, False
otherwise.Method variant with the following signature:
hasAttr(int index)
Predicate returning True
or False
depending on whether an attribute with the given index exists in the attribute set in this XMLToken.
index | an integer, the position of the attribute. |
True
if an attribute with the given index exists in the attribute set in this XMLToken, False
otherwise.Method variant with the following signature:
hasAttr(string name, string uri='')
Predicate returning True
or False
depending on whether an attribute with the given local name and namespace URI exists in the attribute set in this XMLToken.
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 the attribute set in this XMLToken, False
otherwise.def libsbml.XMLToken.hasNamespaceNS | ( | self, | |
args | |||
) |
Python method signature(s):
hasNamespaceNS(XMLToken self, string uri, string prefix)bool
Predicate returning True
or False
depending on whether an XML Namespace with the given uri/prefix pair is contained in the XMLNamespaces ofthis XMLToken.
uri | a string, the uri for the namespace |
prefix | a string, the prefix for the namespace |
True
if an XML Namespace with the given uri/prefix pair is contained in the XMLNamespaces of this XMLToken, False
otherwise. def libsbml.XMLToken.hasNamespacePrefix | ( | self, | |
args | |||
) |
Python method signature(s):
hasNamespacePrefix(XMLToken self, string prefix)bool
Predicate returning True
or False
depending on whether an XML Namespace with the given prefix is contained in the XMLNamespaces of this XMLToken.
prefix | a string, the prefix for the namespace |
True
if an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken, False
otherwise. def libsbml.XMLToken.hasNamespaceURI | ( | self, | |
args | |||
) |
Python method signature(s):
hasNamespaceURI(XMLToken self, string uri)bool
Predicate returning True
or False
depending on whether an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken.
uri | a string, the uri for the namespace |
True
if an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken, False
otherwise. def libsbml.XMLToken.isAttributesEmpty | ( | self | ) |
def libsbml.XMLToken.isElement | ( | self | ) |
def libsbml.XMLToken.isEnd | ( | self | ) |
def libsbml.XMLToken.isEndFor | ( | self, | |
args | |||
) |
def libsbml.XMLToken.isEOF | ( | self | ) |
def libsbml.XMLToken.isNamespacesEmpty | ( | self | ) |
Python method signature(s):
isNamespacesEmpty(XMLToken self)bool
Predicate returning True
or False
depending on whether the XMLNamespaces of this XMLToken is empty.
True
if the XMLNamespaces of this XMLToken is empty, False
otherwise. def libsbml.XMLToken.isStart | ( | self | ) |
def libsbml.XMLToken.isText | ( | self | ) |
def libsbml.XMLToken.removeAttr | ( | self, | |
args | |||
) |
Python method signature(s):
removeAttr(XMLToken self, int n)int removeAttr(XMLToken self, string name, string uri="")
int removeAttr(XMLToken self, string name)
int removeAttr(XMLToken self, XMLTriple triple)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
Method variant with the following signature:
removeAttr(XMLTriple triple)
Removes an attribute with the given XMLTriple from the attribute set in this XMLToken. Nothing will be done if this XMLToken is not a start element.
triple | an XMLTriple, the XML triple of the attribute. |
removeAttr(int n)
Removes an attribute with the given index from the attribute set in this XMLToken. Nothing will be done if this XMLToken is not a start element.
n | an integer the index of the resource to be deleted |
removeAttr(string name, string uri = '')
Removes an attribute with the given local name and namespace URI from the attribute set in this XMLToken. Nothing will be done if this XMLToken is not a start element.
name | a string, the local name of the attribute. |
uri | a string, the namespace URI of the attribute. |
def libsbml.XMLToken.removeNamespace | ( | self, | |
args | |||
) |
Python method signature(s):
removeNamespace(XMLToken self, int index)int removeNamespace(XMLToken self, string prefix)
int
This method has multiple variants that differ in the arguments they accept. Each is described separately below.
Method variant with the following signature:
removeNamespace(int index)
Removes an XML Namespace stored in the given position of the XMLNamespaces of this XMLToken. Nothing will be done if this XMLToken is not a start element.
index | an integer, position of the removed namespace. |
removeNamespace(string prefix)
Removes an XML Namespace with the given prefix. Nothing will be done if this XMLToken is not a start element.
prefix | a string, prefix of the required namespace. |
def libsbml.XMLToken.setAttributes | ( | self, | |
args | |||
) |
Python method signature(s):
setAttributes(XMLToken self, XMLAttributes attributes)int
Sets an XMLAttributes to this XMLToken. Nothing will be done if this XMLToken is not a start element.
attributes | XMLAttributes to be set to this XMLToken. |
def libsbml.XMLToken.setEnd | ( | self | ) |
Python method signature(s):
setEnd(XMLToken self)int
Declares this XML start element is also an end element.
def libsbml.XMLToken.setEOF | ( | self | ) |
def libsbml.XMLToken.setNamespaces | ( | self, | |
args | |||
) |
Python method signature(s):
setNamespaces(XMLToken self, XMLNamespaces namespaces)int
Sets an XMLnamespaces to this XML element. Nothing will be done if this XMLToken is not a start element.
namespaces | XMLNamespaces to be set to this XMLToken. |
def libsbml.XMLToken.setTriple | ( | self, | |
args | |||
) |
Python method signature(s):
setTriple(XMLToken self, XMLTriple triple)int
Sets the XMLTripe (name, uri and prefix) of this XML element. Nothing will be done if this XML element is a text node.
triple | XMLTriple to be added to this XML element. |
def libsbml.XMLToken.toString | ( | self | ) |
Python method signature(s):
toString(XMLToken self)string
Prints a string representation of the underlying token stream, for debugging purposes.
def libsbml.XMLToken.unsetEnd | ( | self | ) |
Python method signature(s):
unsetEnd(XMLToken self)int
Declares this XML start/end element is no longer an end element.