libSBML Python API  5.10.0
 All Classes Namespaces Files Functions Variables Modules Pages
libsbml.XMLNode Class Reference
Inheritance diagram for libsbml.XMLNode:
[legend]

Detailed Description

{core}

Representation of a node in an XML document tree.

Beginning with version 3.0.0, libSBML implements an XML abstraction layer. This layer presents a uniform XML interface to calling programs regardless of which underlying XML parser libSBML has actually been configured to use. The basic data object in the XML abstraction is a node, represented by XMLNode.

An XMLNode can contain any number of children. Each child is another XMLNode, thereby forming a tree. The methods XMLNode.getNumChildren() and XMLNode.getChild() can be used to access the tree structure starting from a given node.

Each XMLNode is subclassed from XMLToken, and thus has the same methods available as XMLToken. These methods include XMLToken.getNamespaces(), XMLToken.getPrefix(), XMLToken.getName(), XMLToken.getURI(), and XMLToken.getAttributes().

Conversion between an XML string and an XMLNode

LibSBML provides the following utility functions for converting an XML string (e.g., <annotation>...</annotation>) to/from an XMLNode object.

The returned XMLNode object by XMLNode.convertStringToXMLNode() is a dummy root (container) XMLNode if the given XML string has two or more top-level elements (e.g., "<code>&lt;p&gt;...&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;</code>"). In the dummy root node, each top-level element in the given XML string is contained as a child XMLNode. XMLToken.isEOF() can be used to identify if the returned XMLNode object is a dummy node or not. Here is an example:

xn = XMLNode.convertStringToXMLNode('<p></p>')
if xn == None:
  # Do something to handle exceptional situation.

elif xn.isEOF():
  # Node is a dummy node.

else:
  # None is not a dummy node.

Public Member Functions

def addAttr
 
def addChild
 
def addNamespace
 
def append
 
def clearAttributes
 
def clearNamespaces
 
def clone
 
def convertStringToXMLNode
 
def convertXMLNodeToString
 
def equals
 
def getAttributes
 
def getAttributesLength
 
def getAttrIndex
 
def getAttrName
 
def getAttrPrefix
 
def getAttrPrefixedName
 
def getAttrURI
 
def getAttrValue
 
def getCharacters
 
def getChild
 
def getColumn
 
def getIndex
 
def getLine
 
def getName
 
def getNamespaceIndex
 
def getNamespaceIndexByPrefix
 
def getNamespacePrefix
 
def getNamespaces
 
def getNamespacesLength
 
def getNamespaceURI
 
def getNumChildren
 
def getPrefix
 
def getURI
 
def hasAttr
 
def hasChild
 
def hasNamespaceNS
 
def hasNamespacePrefix
 
def hasNamespaceURI
 
def insertChild
 
def isAttributesEmpty
 
def isElement
 
def isEnd
 
def isEndFor
 
def isEOF
 
def isNamespacesEmpty
 
def isStart
 
def isText
 
def removeAttr
 
def removeChild
 
def removeChildren
 
def removeNamespace
 
def setAttributes
 
def setEnd
 
def setEOF
 
def setNamespaces
 
def setTriple
 
def toString
 
def toXMLString
 
def unsetEnd
 

Member Function Documentation

def libsbml.XMLToken.addAttr (   self,
  args 
)
inherited

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.

Note
if local name with the same namespace URI already exists in the attribute set, its value and prefix will be replaced.
Parameters
triplean XMLTriple, the XML triple of the attribute.
valuea string, the value of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

Method variant with the following signature:
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.

Parameters
namea string, the local name of the attribute.
valuea string, the value of the attribute.
namespaceURIa string, the namespace URI of the attribute.
prefixa string, the prefix of the namespace
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
if local name with the same namespace URI already exists in the attribute set, its value and prefix will be replaced.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
def libsbml.XMLNode.addChild (   self,
  args 
)

Python method signature(s):

addChild(XMLNode self, XMLNode node)   int

Adds a copy of node as a child of this XMLNode.

The given node is added at the end of the list of children.

Parameters
nodethe XMLNode to be added as child.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
The given node is added at the end of the children list.
def libsbml.XMLToken.addNamespace (   self,
  args 
)
inherited

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.

Parameters
uria string, the uri for the namespace
prefixa string, the prefix for the namespace
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
def libsbml.XMLToken.append (   self,
  args 
)
inherited

Python method signature(s):

append(XMLToken self, string chars)   int

Appends characters to this XML text content.

Parameters
charsstring, characters to append
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLToken.clearAttributes (   self)
inherited

Python method signature(s):

clearAttributes(XMLToken self)   int

Clears (deletes) all attributes in this XMLToken. Nothing will be done if this XMLToken is not a start element.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLToken.clearNamespaces (   self)
inherited

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.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLNode.clone (   self)

{core}

Representation of a node in an XML document tree.

Beginning with version 3.0.0, libSBML implements an XML abstraction layer. This layer presents a uniform XML interface to calling programs regardless of which underlying XML parser libSBML has actually been configured to use. The basic data object in the XML abstraction is a node, represented by XMLNode.

An XMLNode can contain any number of children. Each child is another XMLNode, thereby forming a tree. The methods XMLNode.getNumChildren() and XMLNode.getChild() can be used to access the tree structure starting from a given node.

Each XMLNode is subclassed from XMLToken, and thus has the same methods available as XMLToken. These methods include XMLToken.getNamespaces(), XMLToken.getPrefix(), XMLToken.getName(), XMLToken.getURI(), and XMLToken.getAttributes().

Conversion between an XML string and an XMLNode

LibSBML provides the following utility functions for converting an XML string (e.g., <annotation>...</annotation>) to/from an XMLNode object.

The returned XMLNode object by XMLNode.convertStringToXMLNode() is a dummy root (container) XMLNode if the given XML string has two or more top-level elements (e.g., "<code>&lt;p&gt;...&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;</code>"). In the dummy root node, each top-level element in the given XML string is contained as a child XMLNode. XMLToken.isEOF() can be used to identify if the returned XMLNode object is a dummy node or not. Here is an example:

xn = XMLNode.convertStringToXMLNode('<p></p>')
if xn == None:
  # Do something to handle exceptional situation.

elif xn.isEOF():
  # Node is a dummy node.

else:
  # None is not a dummy node.

Python method signature(s):

clone(XMLNode self)   XMLNode

Creates and returns a deep copy of this XMLNode.

Returns
a (deep) copy of this XMLNode.
def libsbml.XMLNode.convertStringToXMLNode (   args)

Python method signature(s):

convertStringToXMLNode(string xmlstr, XMLNamespaces xmlns=None)   XMLNode
convertStringToXMLNode(string xmlstr)   XMLNode

Returns an XMLNode which is derived from a string containing XML content.

The XML namespace must be defined using argument xmlns if the corresponding XML namespace attribute is not part of the string of the first argument.

Parameters
xmlstrstring to be converted to a XML node.
xmlnsXMLNamespaces the namespaces to set (default value is None).
Note
The caller owns the returned XMLNode and is reponsible for deleting it. The returned XMLNode object is a dummy root (container) XMLNode if the top-level element in the given XML string is NOT <html>, <body>, <annotation>, or <notes>. In the dummy root node, each top-level element in the given XML string is contained as a child XMLNode. XMLToken.isEOF() can be used to identify if the returned XMLNode object is a dummy node.
Returns
a XMLNode which is converted from string xmlstr. If the conversion failed, this method returns None.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
def libsbml.XMLNode.convertXMLNodeToString (   args)

Python method signature(s):

convertXMLNodeToString(XMLNode node)   string

Returns a string representation of a given XMLNode.

Parameters
nodethe XMLNode to be represented as a string
Returns
a string-form representation of node
def libsbml.XMLNode.equals (   self,
  args 
)

Python method signature(s):

equals(XMLNode self, XMLNode other, bool ignoreURI=False)   bool
equals(XMLNode self, XMLNode other)   bool

Compare this XMLNode against another XMLNode returning true if both nodes represent the same XML tree, or false otherwise.

Parameters
otheranother XMLNode to compare against.
ignoreURIwhether to ignore the namespace URI when doing the comparison.
Returns
boolean indicating whether this XMLNode represents the same XML tree as another.
def libsbml.XMLToken.getAttributes (   self)
inherited

Python method signature(s):

getAttributes(XMLToken self)   XMLAttributes

Returns the attributes of this element.

Returns
the XMLAttributes of this XML element.
def libsbml.XMLToken.getAttributesLength (   self)
inherited

Python method signature(s):

getAttributesLength(XMLToken self)   int

Return the number of attributes in the attributes set.

Returns
the number of attributes in the attributes set in this XMLToken.
def libsbml.XMLToken.getAttrIndex (   self,
  args 
)
inherited

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.

Parameters
triplean XMLTriple, the XML triple of the attribute for which the index is required.
Returns
the index of an attribute with the given XMLTriple, or -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.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
the index of an attribute with the given local name and namespace URI, or -1 if not present.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
def libsbml.XMLToken.getAttrName (   self,
  args 
)
inherited

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).

Parameters
indexan integer, the position of the attribute whose local name is required.
Returns
the local name of an attribute in this list (by position).
Note
If index is out of range, an empty string will be returned. Use XMLToken.hasAttr() to test for the attribute existence.
def libsbml.XMLToken.getAttrPrefix (   self,
  args 
)
inherited

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).

Parameters
indexan integer, the position of the attribute whose prefix is required.
Returns
the namespace prefix of an attribute in the attribute set (by position).
Note
If index is out of range, an empty string will be returned. Use XMLToken.hasAttr() to test for the attribute existence.
def libsbml.XMLToken.getAttrPrefixedName (   self,
  args 
)
inherited

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).

Parameters
indexan integer, the position of the attribute whose prefixed name is required.
Returns
the prefixed name of an attribute in the attribute set (by position).
Note
If index is out of range, an empty string will be returned. Use XMLToken.hasAttr() to test for attribute existence.
def libsbml.XMLToken.getAttrURI (   self,
  args 
)
inherited

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).

Parameters
indexan integer, the position of the attribute whose namespace URI is required.
Returns
the namespace URI of an attribute in the attribute set (by position).
Note
If index is out of range, an empty string will be returned. Use XMLToken.hasAttr() to test for attribute existence.
def libsbml.XMLToken.getAttrValue (   self,
  args 
)
inherited

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.

Parameters
triplean XMLTriple, the XML triple of the attribute whose value is required.
Returns
The attribute value as a string.
Note
If an attribute with the given XMLTriple does not exist, an empty string will be returned. Use XMLToken.hasAttr() to test for attribute existence.

Method variant with the following signature:
getAttrValue(int index)

Return the value of an attribute in the attribute set in this XMLToken (by position).

Parameters
indexan integer, the position of the attribute whose value is required.
Returns
the value of an attribute in the attribute set (by position).
Note
If index is out of range, an empty string will be returned. Use XMLToken.hasAttr() to test for attribute existence.

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.

Parameters
namea string, the local name of the attribute whose value is required.
uria string, the namespace URI of the attribute.
Returns
The attribute value as a string.
Note
If an attribute with the given local name and namespace URI does not exist, an empty string will be returned. Use XMLToken.hasAttr() to test for attribute existence.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
def libsbml.XMLToken.getCharacters (   self)
inherited

Python method signature(s):

getCharacters(XMLToken self)   string

Returns the text of this element.

Returns
the characters of this XML text.
def libsbml.XMLNode.getChild (   self,
  args 
)

Python method signature(s):

getChild(XMLNode self, long n)   XMLNode
getChild(XMLNode self, long n)   XMLNode
getChild(XMLNode self, string name)   XMLNode
getChild(XMLNode self, string name)   XMLNode

This method has multiple variants that differ in the arguments they accept. Each is described separately below.


Method variant with the following signature:
getChild(long n)

Returns the nth child of this XMLNode.

If the index n is greater than the number of child nodes, this method returns an empty node.

Parameters
na long integereger, the index of the node to return
Returns
the nth child of this XMLNode.

Method variant with the following signature:
getChild(string  name)

Returns the first child of this XMLNode with the corresponding name.

If no child with corrsponding name can be found, this method returns an empty node.

Parameters
namethe name of the node to return
Returns
the first child of this XMLNode with given name.
def libsbml.XMLToken.getColumn (   self)
inherited

Python method signature(s):

getColumn(XMLToken self)   long

Returns the column at which this XMLToken occurred in the input document or data stream.

Returns
the column at which this XMLToken occurred.
def libsbml.XMLNode.getIndex (   self,
  args 
)

Python method signature(s):

getIndex(XMLNode self, string name)   int

Return the index of the first child of this XMLNode with the given name.

Parameters
namea string, the name of the child for which the index is required.
Returns
the index of the first child of this XMLNode with the given name, or -1 if not present.
def libsbml.XMLToken.getLine (   self)
inherited

Python method signature(s):

getLine(XMLToken self)   long

Returns the line at which this XMLToken occurred in the input document or data stream.

Returns
the line at which this XMLToken occurred.
def libsbml.XMLToken.getName (   self)
inherited

Python method signature(s):

getName(XMLToken self)   string

Returns the (unqualified) name of this XML element.

Returns
the (unqualified) name of this XML element.
def libsbml.XMLToken.getNamespaceIndex (   self,
  args 
)
inherited

Python method signature(s):

getNamespaceIndex(XMLToken self, string uri)   int

Look up the index of an XML namespace declaration by URI.

Parameters
uria string, uri of the required namespace.
Returns
the index of the given declaration, or -1 if not present.
def libsbml.XMLToken.getNamespaceIndexByPrefix (   self,
  args 
)
inherited

Python method signature(s):

getNamespaceIndexByPrefix(XMLToken self, string prefix)   int

Look up the index of an XML namespace declaration by prefix.

Parameters
prefixa string, prefix of the required namespace.
Returns
the index of the given declaration, or -1 if not present.
def libsbml.XMLToken.getNamespacePrefix (   self,
  args 
)
inherited

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.

Parameters
indexan integer, position of the required prefix.
Returns
the prefix of an XML namespace declaration in the XMLNamespaces (by position).
Note
If index is out of range, an empty string will be returned.
See also
getNamespacesLength()

Method variant with the following signature:
getNamespacePrefix(string uri)

Look up the prefix of an XML namespace declaration by its URI.

Parameters
uria string, the URI of the prefix being sought
Returns
the prefix of an XML namespace declaration given its URI.
Note
If uri does not exist, an empty string will be returned.
def libsbml.XMLToken.getNamespaces (   self)
inherited

Python method signature(s):

getNamespaces(XMLToken self)   XMLNamespaces

Returns the XML namespace declarations for this XML element.

Returns
the XML namespace declarations for this XML element.
def libsbml.XMLToken.getNamespacesLength (   self)
inherited

Python method signature(s):

getNamespacesLength(XMLToken self)   int

Returns the number of XML namespaces stored in the XMLNamespaces of this XMLToken.

Returns
the number of namespaces in this list.
def libsbml.XMLToken.getNamespaceURI (   self,
  args 
)
inherited

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.

Parameters
indexan integer, position of the required URI.
Returns
the URI of an XML namespace declaration in the XMLNamespaces (by position).
Note
If index is out of range, an empty string will be returned.
See also
getNamespacesLength()

Method variant with the following signature:
getNamespaceURI(string prefix = '')

Look up the URI of an XML namespace declaration by its prefix.

Parameters
prefixa string, the prefix of the required URI
Returns
the URI of an XML namespace declaration given its prefix.
Note
If prefix does not exist, an empty string will be returned.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
def libsbml.XMLNode.getNumChildren (   self)

Python method signature(s):

getNumChildren(XMLNode self)   long

Returns the number of children for this XMLNode.

Returns
the number of children for this XMLNode.
def libsbml.XMLToken.getPrefix (   self)
inherited

Python method signature(s):

getPrefix(XMLToken self)   string

Returns the namespace prefix of this XML element.

Returns
the namespace prefix of this XML element.
Note
If no prefix exists, an empty string will be return.
def libsbml.XMLToken.getURI (   self)
inherited

Python method signature(s):

getURI(XMLToken self)   string

Returns the namespace URI of this XML element.

Returns
the namespace URI of this XML element.
def libsbml.XMLToken.hasAttr (   self,
  args 
)
inherited

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

Parameters
triplean XMLTriple, the XML triple of the attribute
Returns
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.

Parameters
indexan integer, the position of the attribute.
Returns
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.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
True if an attribute with the given local name and namespace URI exists in the attribute set in this XMLToken, False otherwise.
Documentation note:
The native C++ implementation of this method defines a default argument value. In the documentation generated for different libSBML language bindings, you may or may not see corresponding arguments in the method declarations. For example, in Java and C#, a default argument is handled by declaring two separate methods, with one of them having the argument and the other one lacking the argument. However, the libSBML documentation will be identical for both methods. Consequently, if you are reading this and do not see an argument even though one is described, please look for descriptions of other variants of this method near where this one appears in the documentation.
def libsbml.XMLNode.hasChild (   self,
  args 
)

Python method signature(s):

hasChild(XMLNode self, string name)   bool

Return a boolean indicating whether this XMLNode has a child with the given name.

Parameters
namea string, the name of the child to be checked.
Returns
boolean indicating whether this XMLNode has a child with the given name.
def libsbml.XMLToken.hasNamespaceNS (   self,
  args 
)
inherited

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.

Parameters
uria string, the uri for the namespace
prefixa string, the prefix for the namespace
Returns
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 
)
inherited

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.

Parameters
prefixa string, the prefix for the namespace
Returns
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 
)
inherited

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.

Parameters
uria string, the uri for the namespace
Returns
True if an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken, False otherwise.
def libsbml.XMLNode.insertChild (   self,
  args 
)

Python method signature(s):

insertChild(XMLNode self, long n, XMLNode node)   XMLNode

Inserts a copy of the given node as the nth child of this XMLNode.

If the given index n is out of range for this XMLNode instance, the node is added at the end of the list of children. Even in that situation, this method does not throw an error.

Parameters
nan integer, the index at which the given node is inserted
nodean XMLNode to be inserted as nth child.
Returns
a reference to the newly-inserted child node
def libsbml.XMLToken.isAttributesEmpty (   self)
inherited

Python method signature(s):

isAttributesEmpty(XMLToken self)   bool

Predicate returning True or False depending on whether the attribute set in this XMLToken set is empty.

Returns
True if the attribute set in this XMLToken is empty, False otherwise.
def libsbml.XMLToken.isElement (   self)
inherited

Python method signature(s):

isElement(XMLToken self)   bool

Predicate returning True or False depending on whether this XMLToken is an XML element.

Returns
True if this XMLToken is an XML element, False otherwise.
def libsbml.XMLToken.isEnd (   self)
inherited

Python method signature(s):

isEnd(XMLToken self)   bool

Predicate returning True or False depending on whether this XMLToken is an XML end element.

Returns
True if this XMLToken is an XML end element, False otherwise.
def libsbml.XMLToken.isEndFor (   self,
  args 
)
inherited

Python method signature(s):

isEndFor(XMLToken self, XMLToken element)   bool

Predicate returning True or False depending on whether this XMLToken is an XML end element for the given start element.

Parameters
elementXMLToken, element for which query is made.
Returns
True if this XMLToken is an XML end element for the given XMLToken start element, False otherwise.
def libsbml.XMLToken.isEOF (   self)
inherited

Python method signature(s):

isEOF(XMLToken self)   bool

Predicate returning True or False depending on whether this XMLToken is an end of file marker.

Returns
True if this XMLToken is an end of file (input) marker, False otherwise.
def libsbml.XMLToken.isNamespacesEmpty (   self)
inherited

Python method signature(s):

isNamespacesEmpty(XMLToken self)   bool

Predicate returning True or False depending on whether the XMLNamespaces of this XMLToken is empty.

Returns
True if the XMLNamespaces of this XMLToken is empty, False otherwise.
def libsbml.XMLToken.isStart (   self)
inherited

Python method signature(s):

isStart(XMLToken self)   bool

Predicate returning True or False depending on whether this XMLToken is an XML start element.

Returns
True if this XMLToken is an XML start element, False otherwise.
def libsbml.XMLToken.isText (   self)
inherited

Python method signature(s):

isText(XMLToken self)   bool

Predicate returning True or False depending on whether this XMLToken is an XML text element.

Returns
True if this XMLToken is an XML text element, False otherwise.
def libsbml.XMLToken.removeAttr (   self,
  args 
)
inherited

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.

Parameters
triplean XMLTriple, the XML triple of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

Method variant with the following signature:
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.

Parameters
nan integer the index of the resource to be deleted
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

Method variant with the following signature:
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.

Parameters
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLNode.removeChild (   self,
  args 
)

Python method signature(s):

removeChild(XMLNode self, long n)   XMLNode

Removes the nth child of this XMLNode and returns the removed node.

It is important to keep in mind that a given XMLNode may have more than one child. Calling this method erases all existing references to child nodes after the given position n. If the index n is greater than the number of child nodes in this XMLNode, this method takes no action (and returns None).

Parameters
nan integer, the index of the node to be removed
Returns
the removed child, or None if n is greater than the number of children in this node
Note
The caller owns the returned node and is responsible for deleting it.
def libsbml.XMLNode.removeChildren (   self)

Python method signature(s):

removeChildren(XMLNode self)   int

Removes all children from this node.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLToken.removeNamespace (   self,
  args 
)
inherited

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.

Parameters
indexan integer, position of the removed namespace.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:

Method variant with the following signature:
removeNamespace(string prefix)

Removes an XML Namespace with the given prefix. Nothing will be done if this XMLToken is not a start element.

Parameters
prefixa string, prefix of the required namespace.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLToken.setAttributes (   self,
  args 
)
inherited

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.

Parameters
attributesXMLAttributes to be set to this XMLToken.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
This function replaces the existing XMLAttributes with the new one.
def libsbml.XMLToken.setEnd (   self)
inherited

Python method signature(s):

setEnd(XMLToken self)   int

Declares this XML start element is also an end element.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLToken.setEOF (   self)
inherited

Python method signature(s):

setEOF(XMLToken self)   int

Declares this XMLToken is an end-of-file (input) marker.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLToken.setNamespaces (   self,
  args 
)
inherited

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.

Parameters
namespacesXMLNamespaces to be set to this XMLToken.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
This function replaces the existing XMLNamespaces with the new one.
def libsbml.XMLToken.setTriple (   self,
  args 
)
inherited

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.

Parameters
tripleXMLTriple to be added to this XML element.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.XMLToken.toString (   self)
inherited

Python method signature(s):

toString(XMLToken self)   string

Prints a string representation of the underlying token stream, for debugging purposes.

def libsbml.XMLNode.toXMLString (   self)

Python method signature(s):

toXMLString(XMLNode self)   string

Returns a string representation of this XMLNode.

Returns
a string derived from this XMLNode.
def libsbml.XMLToken.unsetEnd (   self)
inherited

Python method signature(s):

unsetEnd(XMLToken self)   int

Declares this XML start/end element is no longer an end element.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are: