libSBML Python API
5.18.0
|
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.
The libSBML XML parser interface can read an XML file or data stream and convert the contents into tokens. The tokens represent items in the XML stream, either XML elements (start or end tags) or text that appears as content inside an element. The XMLToken class is libSBML's low-level representation of these entities.
Each XMLToken has the following information associated with it:
<mytag>
, the name is 'mytag'
), but this name may be qualified with a namespace (e.g., it may appear as <someNamespace:mytag>
in the input). An XMLToken stores the name of a token, along with any namespace qualification present, through the use of an XMLTriple object. This object stores the bare name of the element, its XML namespace prefix (if any), and the XML namespace with which that prefix is associated. The XMLToken class serves as base class for XMLNode. XML lends itself to a tree-structured representation, and in libSBML, the nodes in an XML document tree are XMLNode objects. Most higher-level libSBML classes and methods that offer XML-level functionality (such as the methods on SBase for interacting with annotations) work with XMLNode objects rather than XMLToken objects directly.
Public Member Functions | |
def | __init__ (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | addAttr (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | addNamespace (self, args) |
Appends an XML namespace declaration to this token. More... | |
def | append (self, chars) |
Appends characters to the text content of token. More... | |
def | clearAttributes (self) |
Removes all attributes of this XMLToken object. More... | |
def | clearNamespaces (self) |
Removes all XML namespace declarations from this token. More... | |
def | clone (self) |
Creates and returns a deep copy of this XMLToken object. More... | |
def | getAttributes (self) |
Returns the attributes of the XML element represented by this token. More... | |
def | getAttributesLength (self) |
Returns the number of attributes on this XMLToken object. More... | |
def | getAttrIndex (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | getAttrName (self, index) |
Returns the name of the nth attribute in this token's list of attributes. More... | |
def | getAttrPrefix (self, index) |
Returns the prefix of the nth attribute in this token's list of attributes. More... | |
def | getAttrPrefixedName (self, index) |
Returns the prefixed name of the nth attribute in this token's list of attributes. More... | |
def | getAttrURI (self, index) |
Returns the XML namespace URI of the nth attribute in this token's list of attributes. More... | |
def | getAttrValue (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | getCharacters (self) |
Returns the character text of token. More... | |
def | getColumn (self) |
Returns the column number at which this token occurs in the input. More... | |
def | getLine (self) |
Returns the line number at which this token occurs in the input. More... | |
def | getName (self) |
Returns the (unqualified) name of token. More... | |
def | getNamespaceIndex (self, uri) |
Returns the index of an XML namespace declaration based on its URI. More... | |
def | getNamespaceIndexByPrefix (self, prefix) |
Returns the index of an XML namespace declaration based on its prefix. More... | |
def | getNamespacePrefix (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | getNamespaces (self) |
Returns the XML namespaces declared for this token. More... | |
def | getNamespacesLength (self) |
Returns the number of XML namespaces declared on this token. More... | |
def | getNamespaceURI (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | getPrefix (self) |
Returns the XML namespace prefix of token. More... | |
def | getURI (self) |
Returns the XML namespace URI of token. More... | |
def | hasAttr (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | hasNamespaceNS (self, uri, prefix) |
Returns True if this token has an XML namespace with a given prefix and URI combination. More... | |
def | hasNamespacePrefix (self, prefix) |
Returns True if this token has an XML namespace with a given prefix. More... | |
def | hasNamespaceURI (self, uri) |
Returns True if this token has an XML namespace with a given URI. More... | |
def | isAttributesEmpty (self) |
Returns True if this token has no attributes. More... | |
def | isElement (self) |
Returns True if this token represents an XML element. More... | |
def | isEnd (self) |
Returns True if this token represents an XML end element. More... | |
def | isEndFor (self, element) |
Returns True if this token represents an XML end element for a particular start element. More... | |
def | isEOF (self) |
Returns True if this token is an end of file marker. More... | |
def | isNamespacesEmpty (self) |
Returns True if there are no namespaces declared on this token. More... | |
def | isStart (self) |
Returns True if this token represents an XML start element. More... | |
def | isText (self) |
Returns True if this token represents an XML text element. More... | |
def | removeAttr (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | removeNamespace (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | setAttributes (self, attributes) |
Sets the attributes on the XML element represented by this token. More... | |
def | setCharacters (self, chars) |
Sets the characters for this XMLToken. More... | |
def | setEnd (self) |
Declares that this token represents an XML element end tag. More... | |
def | setEOF (self) |
Declares that this token is an end-of-file/input marker. More... | |
def | setNamespaces (self, namespaces) |
Sets the XML namespaces on this XML element. More... | |
def | setTriple (self, triple) |
Sets the name, namespace prefix and namespace URI of this token. More... | |
def | toString (self) |
Prints a string representation of the underlying token stream. More... | |
def | unsetEnd (self) |
Declares that this token no longer represents an XML start/end element. More... | |
def libsbml.XMLToken.__init__ | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
__init__() XMLToken __init__(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line=0, long column=0) XMLToken __init__(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line=0) XMLToken __init__(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces) XMLToken __init__(XMLTriple triple, XMLAttributes attributes, long line=0, long column=0) XMLToken __init__(XMLTriple triple, XMLAttributes attributes, long line=0) XMLToken __init__(XMLTriple triple, XMLAttributes attributes) XMLToken __init__(XMLTriple triple, long line=0, long column=0) XMLToken __init__(XMLTriple triple, long line=0) XMLToken __init__(XMLTriple triple) XMLToken __init__(string chars, long line=0, long column=0) XMLToken __init__(string chars, long line=0) XMLToken __init__(string chars) XMLToken __init__(XMLToken orig) XMLToken
Each variant is described separately below.
XMLToken()
Creates a new empty XMLToken object.
XMLToken(XMLToken orig)
Copy constructor; creates a copy of this XMLToken object.
orig | the XMLToken object to copy. |
XMLToken(XMLTriple triple, XMLAttributes attributes, long line = 0, long column = 0)
Creates an XML start element with attributes.
triple | an XMLTriple object describing the start tag. |
attributes | XMLAttributes, the attributes to set on the element to be created. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
The XML namespace component of this XMLToken object will be left empty. See the other variants of the XMLToken constructors for versions that take namespace arguments.
parameter
= value
. This is not to be intepreted as a Python keyword argument; the use of a parameter name followed by an equals sign followed by a value is only meant to indicate a default value if the argument is not provided at all. It is not a keyword in the Python sense.XMLToken(XMLTriple triple, long line = 0, long column = 0)
Creates an XML end element.
triple | an XMLTriple object describing the end tag. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
parameter
= value
. This is not to be intepreted as a Python keyword argument; the use of a parameter name followed by an equals sign followed by a value is only meant to indicate a default value if the argument is not provided at all. It is not a keyword in the Python sense.XMLToken(XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line = 0, long column = 0)
Creates an XML start element with attributes and namespace declarations.
triple | an XMLTriple object describing the start tag. |
attributes | XMLAttributes, the attributes to set on the element to be created. |
namespaces | XMLNamespaces, the namespaces to set on the element to be created. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
parameter
= value
. This is not to be intepreted as a Python keyword argument; the use of a parameter name followed by an equals sign followed by a value is only meant to indicate a default value if the argument is not provided at all. It is not a keyword in the Python sense.XMLToken(string chars, long line = 0, long column = 0)
Creates a text object.
chars | a string, the text to be added to the XMLToken object. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
parameter
= value
. This is not to be intepreted as a Python keyword argument; the use of a parameter name followed by an equals sign followed by a value is only meant to indicate a default value if the argument is not provided at all. It is not a keyword in the Python sense. def libsbml.XMLToken.addAttr | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
addAttr(string name, string value, string namespaceURI, string prefix) int addAttr(string name, string value, string namespaceURI) int addAttr(string name, string value) int addAttr(XMLTriple triple, string value) int
Each variant is described separately below.
addAttr(string name, string value, string namespaceURI = '', string prefix = '')
Adds an attribute to the XML element represented by this token.
name | a string, the so-called 'local part' of the attribute name; that is, the attribute name without any namespace qualifier or prefix. |
value | a string, the value assigned to the attribute. |
namespaceURI | a string, the XML namespace URI of the attribute. |
prefix | a string, the prefix for the XML namespace. |
Recall that in XML, the complete form of an attribute on an XML element is the following:
prefix:name='value'
The name
part is the name of the attribute, the 'value'
part is the value assigned to the attribute (and it is always a quoted string), and the prefix
part is an optional XML namespace prefix. Internally in libSBML, this data is stored in an XMLAttributes object associated with this XMLToken.
parameter
= value
. This is not to be intepreted as a Python keyword argument; the use of a parameter name followed by an equals sign followed by a value is only meant to indicate a default value if the argument is not provided at all. It is not a keyword in the Python sense.addAttr(XMLTriple triple, string value)
Adds an attribute to the XML element represented by this token.
triple | an XMLTriple object defining the attribute, its value, and optionally its XML namespace (if any is provided). |
value | a string, the value assigned to the attribute. |
def libsbml.XMLToken.addNamespace | ( | self, | |
args | |||
) |
Appends an XML namespace declaration to this token.
addNamespace(string uri, string prefix) int addNamespace(string uri) int
The namespace added will be defined by the given XML namespace URI and an optional prefix. If this XMLToken object already possesses an XML namespace declaration with the given prefix
, then the existing XML namespace URI will be overwritten by the new one given by uri
.
uri | a string, the XML namespace URI for the namespace. |
prefix | a string, the namespace prefix to use. |
parameter
= value
. This is not to be intepreted as a Python keyword argument; the use of a parameter name followed by an equals sign followed by a value is only meant to indicate a default value if the argument is not provided at all. It is not a keyword in the Python sense. def libsbml.XMLToken.append | ( | self, | |
chars | |||
) |
Appends characters to the text content of token.
append(string chars) int
This method only makes sense for XMLToken objects that contains text. If this method is called on a token that represents an XML start or end tag, it will return the code LIBSBML_OPERATION_FAILED.
chars | string, characters to append to the text of this token. |
def libsbml.XMLToken.clearAttributes | ( | self | ) |
Removes all attributes of this XMLToken object.
clearAttributes() int
def libsbml.XMLToken.clearNamespaces | ( | self | ) |
Removes all XML namespace declarations from this token.
clearNamespaces() int
def libsbml.XMLToken.clone | ( | self | ) |
def libsbml.XMLToken.getAttributes | ( | self | ) |
Returns the attributes of the XML element represented by this token.
getAttributes() XMLAttributes
def libsbml.XMLToken.getAttributesLength | ( | self | ) |
def libsbml.XMLToken.getAttrIndex | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
getAttrIndex(string name, string uri) int getAttrIndex(string name) int getAttrIndex(XMLTriple triple) int
Each variant is described separately below.
getAttrIndex(string name, string uri='')
Returns the index of the attribute with the given name and namespace URI.
name | a string, the name of the attribute. |
uri | a string, the namespace URI of the attribute. |
-1
if it is not present on this token.getAttrIndex(XMLTriple triple)
Returns the index of the attribute defined by the given XMLTriple object.
triple | the XMLTriple object that defines the attribute whose index is being sought. |
-1
if no such attribute is present on this token. def libsbml.XMLToken.getAttrName | ( | self, | |
index | |||
) |
Returns the name of the nth attribute in this token's list of attributes.
getAttrName(int index) string
index | an integer, the position of the attribute whose name is being sought. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken.hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken.getAttributesLength() can be used to find out the number of attributes possessed by this token.def libsbml.XMLToken.getAttrPrefix | ( | self, | |
index | |||
) |
Returns the prefix of the nth attribute in this token's list of attributes.
getAttrPrefix(int index) string
index | an integer, the position of the attribute whose prefix is being sought. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken.hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken.getAttributesLength() can be used to find out the number of attributes possessed by this token.def libsbml.XMLToken.getAttrPrefixedName | ( | self, | |
index | |||
) |
Returns the prefixed name of the nth attribute in this token's list of attributes.
getAttrPrefixedName(int index) string
In this context, prefixed name means the name of the attribute prefixed with the XML namespace prefix assigned to the attribute. This will be a string of the form prefix:name
.
index | an integer, the position of the attribute whose prefixed name is being sought. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken.hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken.getAttributesLength() can be used to find out the number of attributes possessed by this token. def libsbml.XMLToken.getAttrURI | ( | self, | |
index | |||
) |
Returns the XML namespace URI of the nth attribute in this token's list of attributes.
getAttrURI(int index) string
index | an integer, the position of the attribute whose namespace URI is being sought. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken.hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken.getAttributesLength() can be used to find out the number of attributes possessed by this token. def libsbml.XMLToken.getAttrValue | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
getAttrValue(int index) string getAttrValue(string name, string uri) string getAttrValue(string name) string getAttrValue(XMLTriple triple) string
Each variant is described separately below.
getAttrValue(string name, string uri='')
Returns the value of the attribute with a given name and XML namespace URI.
name | a string, the name of the attribute whose value is being sought. |
uri | a string, the XML namespace URI of the attribute. |
name
and uri
does not exist on this token object, this method will return an empty string. XMLToken.hasAttr() can be used to test explicitly for the presence of an attribute with a given name and namespace.getAttrValue(XMLTriple triple)
Returns the value of the attribute specified by a given XMLTriple object.
triple | an XMLTriple describing the attribute whose value is being sought. |
triple
does not exist on this token object, this method will return an empty string. XMLToken.hasAttr() can be used to test explicitly for the existence of an attribute with the properties of a given triple.getAttrValue(int index)
Returns the value of the nth attribute in this token's list of attributes.
index | an integer, the position of the attribute whose value is required. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken.hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken.getAttributesLength() can be used to find out the number of attributes possessed by this token. def libsbml.XMLToken.getCharacters | ( | self | ) |
Returns the character text of token.
getCharacters() string
def libsbml.XMLToken.getColumn | ( | self | ) |
Returns the column number at which this token occurs in the input.
getColumn() long
def libsbml.XMLToken.getLine | ( | self | ) |
Returns the line number at which this token occurs in the input.
getLine() long
def libsbml.XMLToken.getName | ( | self | ) |
Returns the (unqualified) name of token.
getName() string
def libsbml.XMLToken.getNamespaceIndex | ( | self, | |
uri | |||
) |
Returns the index of an XML namespace declaration based on its URI.
getNamespaceIndex(string uri) int
uri | a string, the XML namespace URI of the sought-after namespace. |
-1
if no such namespace URI is present on this XMLToken object. def libsbml.XMLToken.getNamespaceIndexByPrefix | ( | self, | |
prefix | |||
) |
Returns the index of an XML namespace declaration based on its prefix.
getNamespaceIndexByPrefix(string prefix) int
prefix | a string, the prefix of the sought-after XML namespace. |
-1
if no such namespace URI is present on this XMLToken object. def libsbml.XMLToken.getNamespacePrefix | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
getNamespacePrefix(int index) string getNamespacePrefix(string uri) string
Each variant is described separately below.
getNamespacePrefix(int index)
Returns the prefix of the nth XML namespace declaration.
index | an integer, position of the required prefix. |
index
is out of range, this method will return an empty string. XMLToken.getNamespacesLength() can be used to find out how many namespaces are defined on this XMLToken object.getNamespacePrefix(string uri)
Returns the prefix associated with a given XML namespace URI on this token.
uri | a string, the URI of the namespace whose prefix is being sought. |
uri
declared on this XMLToken object, this method will return an empty string. def libsbml.XMLToken.getNamespaces | ( | self | ) |
Returns the XML namespaces declared for this token.
getNamespaces() XMLNamespaces
def libsbml.XMLToken.getNamespacesLength | ( | self | ) |
Returns the number of XML namespaces declared on this token.
getNamespacesLength() int
def libsbml.XMLToken.getNamespaceURI | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
getNamespaceURI(int index) string getNamespaceURI(string prefix) string getNamespaceURI() string
Each variant is described separately below.
getNamespaceURI(string prefix = '')
Returns the URI of an XML namespace with a given prefix.
prefix | a string, the prefix of the sought-after XML namespace URI. |
prefix
stored in the XMLNamespaces object of this XMLToken object, this method will return an empty string.parameter
= value
. This is not to be intepreted as a Python keyword argument; the use of a parameter name followed by an equals sign followed by a value is only meant to indicate a default value if the argument is not provided at all. It is not a keyword in the Python sense.getNamespaceURI(int index)
Returns the URI of the nth XML namespace declared on this token.
index | an integer, the position of the sought-after XML namespace URI. |
index
is out of range, this method will return an empty string.def libsbml.XMLToken.getPrefix | ( | self | ) |
Returns the XML namespace prefix of token.
getPrefix() string
def libsbml.XMLToken.getURI | ( | self | ) |
Returns the XML namespace URI of token.
getURI() string
def libsbml.XMLToken.hasAttr | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
hasAttr(int index) bool hasAttr(string name, string uri) bool hasAttr(string name) bool hasAttr(XMLTriple triple) bool
Each variant is described separately below.
hasAttr(string name, string uri='')
Returns True
if an attribute with a given name and namespace URI exists.
name | a string, the name of the attribute being sought. |
uri | a string, the XML namespace URI of the attribute being sought. |
True
if an attribute with the given local name and namespace URI exists in the list of attributes on this token object, False
otherwise.hasAttr(XMLTriple triple)
Returns True
if an attribute defined by a given XMLTriple object exists.
triple | an XMLTriple object describing the attribute being sought. |
True
if an attribute matching the properties of the given XMLTriple object exists in the list of attributes on this token, False
otherwise.hasAttr(int index)
Returns True
if an attribute with the given index exists.
index | an integer, the position of the attribute. |
True
if this token object possesses an attribute with the given index, False
otherwise. def libsbml.XMLToken.hasNamespaceNS | ( | self, | |
uri, | |||
prefix | |||
) |
Returns True
if this token has an XML namespace with a given prefix and URI combination.
hasNamespaceNS(string uri, string prefix) bool
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 object of this XMLToken object, False
otherwise. def libsbml.XMLToken.hasNamespacePrefix | ( | self, | |
prefix | |||
) |
Returns True
if this token has an XML namespace with a given prefix.
hasNamespacePrefix(string prefix) bool
prefix | a string, the prefix for the XML 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, | |
uri | |||
) |
Returns True
if this token has an XML namespace with a given URI.
hasNamespaceURI(string uri) bool
uri | a string, the URI of the XML namespace. |
True
if an XML namespace with the given URI is contained in the XMLNamespaces object of this XMLToken object, False
otherwise. def libsbml.XMLToken.isAttributesEmpty | ( | self | ) |
Returns True
if this token has no attributes.
isAttributesEmpty() bool
True
if the list of attributes on XMLToken object is empty, False
otherwise. def libsbml.XMLToken.isElement | ( | self | ) |
Returns True
if this token represents an XML element.
isElement() bool
This generic predicate returns True
if the element is either a start or end tag, and False
if it's a text object. The related methods XMLToken:isStart(), XMLToken.isEnd() and XMLToken.isText() are more specific predicates.
True
if this XMLToken object represents an XML element, False
otherwise.def libsbml.XMLToken.isEnd | ( | self | ) |
Returns True
if this token represents an XML end element.
isEnd() bool
True
if this XMLToken object represents an XML end element, False
otherwise.def libsbml.XMLToken.isEndFor | ( | self, | |
element | |||
) |
Returns True
if this token represents an XML end element for a particular start element.
isEndFor(XMLToken element) bool
element | XMLToken, the element with which the current object should be compared to determined whether the current object is a start element for the given one. |
True
if this XMLToken object represents an XML end tag for the start tag given by element
, False
otherwise.def libsbml.XMLToken.isEOF | ( | self | ) |
def libsbml.XMLToken.isNamespacesEmpty | ( | self | ) |
Returns True
if there are no namespaces declared on this token.
isNamespacesEmpty() bool
True
if the XMLNamespaces object stored in this XMLToken token is empty, False
otherwise. def libsbml.XMLToken.isStart | ( | self | ) |
Returns True
if this token represents an XML start element.
isStart() bool
True
if this XMLToken is an XML start element, False
otherwise.def libsbml.XMLToken.isText | ( | self | ) |
Returns True
if this token represents an XML text element.
isText() bool
True
if this XMLToken is an XML text element, False
otherwise.def libsbml.XMLToken.removeAttr | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
removeAttr(int n) int removeAttr(string name, string uri) int removeAttr(string name) int removeAttr(XMLTriple triple) int
Each variant is described separately below.
removeAttr(string name, string uri = '')
Removes an attribute from the XML element represented by this token.
name | a string, the name of the attribute to be removed. |
uri | a string, the XML namespace URI of the attribute to be removed. |
name
(and uri
if specified).parameter
= value
. This is not to be intepreted as a Python keyword argument; the use of a parameter name followed by an equals sign followed by a value is only meant to indicate a default value if the argument is not provided at all. It is not a keyword in the Python sense.removeAttr(int n)
Removes the nth attribute from the XML element represented by this token.
n | an integer the index of the resource to be deleted. |
n
.removeAttr(XMLTriple triple)
Removes an attribute from the XML element represented by this token.
triple | an XMLTriple describing the attribute to be removed. |
triple
.def libsbml.XMLToken.removeNamespace | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
removeNamespace(int index) int removeNamespace(string prefix) int
Each variant is described separately below.
removeNamespace(int index)
Removes the nth XML namespace declaration.
index | an integer, the position of the namespace to be removed. The position in this context refers to the position of the namespace in the XMLNamespaces object stored in this XMLToken object. Callers can use one of the getNamespace___() methods to find the index number of a given namespace. |
removeNamespace(string prefix)
Removes an XML namespace declaration having a given prefix.
prefix | a string, the prefix of the namespace to be removed. |
prefix
on this element.def libsbml.XMLToken.setAttributes | ( | self, | |
attributes | |||
) |
Sets the attributes on the XML element represented by this token.
setAttributes(XMLAttributes attributes) int
attributes | an XMLAttributes object to be assigned to this XMLToken object, thereby setting the XML attributes associated with this token. |
attributes
. def libsbml.XMLToken.setCharacters | ( | self, | |
chars | |||
) |
Sets the characters for this XMLToken.
This method only makes sense for XMLToken objects that contains text.
setCharacters(string chars) int
If this method is called on a token that represents an XML start or end tag, it will return the code LIBSBML_OPERATION_FAILED.
chars | string, characters to append to the text of this token. |
def libsbml.XMLToken.setEnd | ( | self | ) |
Declares that this token represents an XML element end tag.
setEnd() int
def libsbml.XMLToken.setEOF | ( | self | ) |
Declares that this token is an end-of-file/input marker.
setEOF() int
def libsbml.XMLToken.setNamespaces | ( | self, | |
namespaces | |||
) |
Sets the XML namespaces on this XML element.
setNamespaces(XMLNamespaces namespaces) int
namespaces | the XMLNamespaces object to be assigned to this XMLToken object. |
namespaces
. def libsbml.XMLToken.setTriple | ( | self, | |
triple | |||
) |
Sets the name, namespace prefix and namespace URI of this token.
setTriple(XMLTriple triple) int
triple | the new XMLTriple to use for this XMLToken object. If this XMLToken already had an XMLTriple object stored within it, that object will be replaced. |
def libsbml.XMLToken.toString | ( | self | ) |
Prints a string representation of the underlying token stream.
toString() string
This method is intended for debugging purposes.
def libsbml.XMLToken.unsetEnd | ( | self | ) |
Declares that this token no longer represents an XML start/end element.
unsetEnd() int