libsbml.XMLNode Class Reference

Inheritance diagram for libsbml.XMLNode:

Inheritance graph
[legend]

List of all members.


Detailed Description

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

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., '<p>...</p><p>...</p>'). 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:

Definition at line 28651 of file libsbml.py.


Public Member Functions

def __eq__
def __init__
def __ne__
def addAttr
def addChild
def addNamespace
def append
def clearAttributes
def clearNamespaces
def clone
def convertStringToXMLNode
def convertXMLNodeToString
def getAttributes
def getAttributesLength
def getAttrIndex
def getAttrName
def getAttrPrefix
def getAttrPrefixedName
def getAttrURI
def getAttrValue
def getCharacters
def getChild
def getColumn
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 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

Public Attributes

 this

Member Function Documentation

def libsbml.XMLToken.__eq__ (   self,
  rhs 
) [inherited]

Definition at line 28634 of file libsbml.py.

def libsbml.XMLNode.__init__ (   self,
  args 
)

Python method signature(s):

__init__(self)    XMLNode
__init__(self, XMLToken token)    XMLNode
__init__(self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, 
    unsigned int line = 0, unsigned int column = 0)    XMLNode
__init__(self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, 
    unsigned int line = 0)    XMLNode
__init__(self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces)    XMLNode
__init__(self, XMLTriple triple, XMLAttributes attributes, unsigned int line = 0, 
    unsigned int column = 0)    XMLNode
__init__(self, XMLTriple triple, XMLAttributes attributes, unsigned int line = 0)    XMLNode
__init__(self, XMLTriple triple, XMLAttributes attributes)    XMLNode
__init__(self, XMLTriple triple, unsigned int line = 0, unsigned int column = 0)    XMLNode
__init__(self, XMLTriple triple, unsigned int line = 0)    XMLNode
__init__(self, XMLTriple triple)    XMLNode
__init__(self, string chars, unsigned int line = 0, unsigned int column = 0)    XMLNode
__init__(self, string chars, unsigned int line = 0)    XMLNode
__init__(self, string chars)    XMLNode
__init__(self, XMLNode orig)    XMLNode

Copy constructor; creates a copy of this XMLNode.

Parameters:
orig the XMLNode instance to copy.

Reimplemented from libsbml.XMLToken.

Definition at line 28756 of file libsbml.py.

def libsbml.XMLToken.__ne__ (   self,
  rhs 
) [inherited]

Definition at line 28641 of file libsbml.py.

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

Python method signature(s):

addAttr(self, string name, string value, string namespaceURI = "", 
    string prefix = "")    int
addAttr(self, string name, string value, string namespaceURI = "")    int
addAttr(self, string name, string value)    int
addAttr(self, XMLTriple triple, string value)    int

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:
triple an XMLTriple, the XML triple of the attribute.
value a string, the value of the attribute.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION

Definition at line 27739 of file libsbml.py.

def libsbml.XMLNode.addChild (   self,
  args 
)

Python method signature(s):

addChild(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:
node the XMLNode to be added as child.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION
Note:
The given node is added at the end of the children list.

Definition at line 28804 of file libsbml.py.

def libsbml.XMLToken.addNamespace (   self,
  args 
) [inherited]

Python method signature(s):

addNamespace(self, string uri, string prefix = "")    int
addNamespace(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:
uri a string, the uri for the namespace
prefix a string, the prefix for the namespace
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION
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, 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.

Definition at line 28052 of file libsbml.py.

def libsbml.XMLToken.append (   self,
  args 
) [inherited]

Python method signature(s):

append(self, string chars)    int

Appends characters to this XML text content.

Parameters:
chars string, characters to append
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED

Definition at line 28406 of file libsbml.py.

def libsbml.XMLToken.clearAttributes (   self  )  [inherited]

Python method signature(s):

clearAttributes(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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION

Definition at line 27799 of file libsbml.py.

def libsbml.XMLToken.clearNamespaces (   self  )  [inherited]

Python method signature(s):

clearNamespaces(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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION

Definition at line 28117 of file libsbml.py.

def libsbml.XMLNode.clone (   self  ) 

Python method signature(s):

clone(self)    XMLNode

Creates and returns a deep copy of this XMLNode.

Returns:
a (deep) copy of this XMLNode.

Reimplemented from libsbml.XMLToken.

Definition at line 28789 of file libsbml.py.

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:
xmlstr string to be converted to a XML node.
xmlns XMLNamespaces the namespaces to set (default value is NULL).
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, 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. NULL is returned if the conversion failed.
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, 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.

Definition at line 28968 of file libsbml.py.

def libsbml.XMLNode.convertXMLNodeToString (   args  ) 

Python method signature(s):

convertXMLNodeToString(XMLNode node)    string

Returns a string representation of a given XMLNode.

Parameters:
node the XMLNode to be represented as a string
Returns:
a string-form representation of node

Definition at line 28949 of file libsbml.py.

def libsbml.XMLToken.getAttributes (   self  )  [inherited]

Python method signature(s):

getAttributes(self)    XMLAttributes

Returns the attributes of this element.

Returns:
the XMLAttributes of this XML element.

Definition at line 27699 of file libsbml.py.

def libsbml.XMLToken.getAttributesLength (   self  )  [inherited]

Python method signature(s):

getAttributesLength(self)    int

Return the number of attributes in the attributes set.

Returns:
the number of attributes in the attributes set in this XMLToken.

Definition at line 27840 of file libsbml.py.

def libsbml.XMLToken.getAttrIndex (   self,
  args 
) [inherited]

Python method signature(s):

getAttrIndex(self, string name, string uri = "")    int
getAttrIndex(self, string name)    int
getAttrIndex(self, XMLTriple triple)    int

Return the index of an attribute with the given XMLTriple.

Parameters:
triple an 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.

Definition at line 27820 of file libsbml.py.

def libsbml.XMLToken.getAttrName (   self,
  args 
) [inherited]

Python method signature(s):

getAttrName(self, int index)    string

Return the local name of an attribute in the attributes set in this XMLToken (by position).

Parameters:
index an 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 hasAttr(index) to test for the attribute existence.

Definition at line 27855 of file libsbml.py.

def libsbml.XMLToken.getAttrPrefix (   self,
  args 
) [inherited]

Python method signature(s):

getAttrPrefix(self, int index)    string

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

Parameters:
index an 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 hasAttr(index) to test for the attribute existence.

Definition at line 27878 of file libsbml.py.

def libsbml.XMLToken.getAttrPrefixedName (   self,
  args 
) [inherited]

Python method signature(s):

getAttrPrefixedName(self, int index)    string

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

Parameters:
index an 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 hasAttr(index) to test for attribute existence.

Definition at line 27901 of file libsbml.py.

def libsbml.XMLToken.getAttrURI (   self,
  args 
) [inherited]

Python method signature(s):

getAttrURI(self, int index)    string

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

Parameters:
index an 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 hasAttr(index) to test for attribute existence.

Definition at line 27924 of file libsbml.py.

def libsbml.XMLToken.getAttrValue (   self,
  args 
) [inherited]

Python method signature(s):

getAttrValue(self, int index)    string
getAttrValue(self, string name, string uri = "")    string
getAttrValue(self, string name)    string
getAttrValue(self, XMLTriple triple)    string

Return a value of an attribute with the given XMLTriple.

Parameters:
triple an 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 hasAttr(triple) to test for attribute existence.

Definition at line 27946 of file libsbml.py.

def libsbml.XMLToken.getCharacters (   self  )  [inherited]

Python method signature(s):

getCharacters(self)    string

Returns the text of this element.

Returns:
the characters of this XML text.

Definition at line 28391 of file libsbml.py.

def libsbml.XMLNode.getChild (   self,
  args 
)

Python method signature(s):

getChild(self, unsigned int n)    XMLNode
getChild(self, unsigned int n)    XMLNode

Returns the nth child of this XMLNode.

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

Parameters:
n an integer, the index of the node to return
Returns:
the nth child of this XMLNode.

Definition at line 28898 of file libsbml.py.

def libsbml.XMLToken.getColumn (   self  )  [inherited]

Python method signature(s):

getColumn(self)    unsigned int

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

Returns:
the column at which this XMLToken occurred.

Definition at line 28428 of file libsbml.py.

def libsbml.XMLToken.getLine (   self  )  [inherited]

Python method signature(s):

getLine(self)    unsigned int

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

Returns:
the line at which this XMLToken occurred.

Definition at line 28444 of file libsbml.py.

def libsbml.XMLToken.getName (   self  )  [inherited]

Python method signature(s):

getName(self)    string

Returns the (unqualified) name of this XML element.

Returns:
the (unqualified) name of this XML element.

Definition at line 28343 of file libsbml.py.

def libsbml.XMLToken.getNamespaceIndex (   self,
  args 
) [inherited]

Python method signature(s):

getNamespaceIndex(self, string uri)    int

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

Parameters:
uri a string, uri of the required namespace.
Returns:
the index of the given declaration, or -1 if not present.

Definition at line 28139 of file libsbml.py.

def libsbml.XMLToken.getNamespaceIndexByPrefix (   self,
  args 
) [inherited]

Python method signature(s):

getNamespaceIndexByPrefix(self, string prefix)    int

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

Parameters:
prefix a string, prefix of the required namespace.
Returns:
the index of the given declaration, or -1 if not present.

Definition at line 28156 of file libsbml.py.

def libsbml.XMLToken.getNamespacePrefix (   self,
  args 
) [inherited]

Python method signature(s):

getNamespacePrefix(self, int index)    string
getNamespacePrefix(self, string uri)    string

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

Parameters:
uri a 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.

Definition at line 28189 of file libsbml.py.

def libsbml.XMLToken.getNamespaces (   self  )  [inherited]

Python method signature(s):

getNamespaces(self)    XMLNamespaces

Returns the XML namespace declarations for this XML element.

Returns:
the XML namespace declarations for this XML element.

Definition at line 28012 of file libsbml.py.

def libsbml.XMLToken.getNamespacesLength (   self  )  [inherited]

Python method signature(s):

getNamespacesLength(self)    int

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

Returns:
the number of namespaces in this list.

Definition at line 28173 of file libsbml.py.

def libsbml.XMLToken.getNamespaceURI (   self,
  args 
) [inherited]

Python method signature(s):

getNamespaceURI(self, int index)    string
getNamespaceURI(self, string prefix = "")    string
getNamespaceURI(self)    string

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

Parameters:
prefix a 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.
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, 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.

Definition at line 28209 of file libsbml.py.

def libsbml.XMLNode.getNumChildren (   self  ) 

Python method signature(s):

getNumChildren(self)    unsigned int

Returns the number of children for this XMLNode.

Returns:
the number of children for this XMLNode.

Definition at line 28919 of file libsbml.py.

def libsbml.XMLToken.getPrefix (   self  )  [inherited]

Python method signature(s):

getPrefix(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.

Definition at line 28358 of file libsbml.py.

def libsbml.XMLToken.getURI (   self  )  [inherited]

Python method signature(s):

getURI(self)    string

Returns the namespace URI of this XML element.

Returns:
the namespace URI of this XML element.

Definition at line 28376 of file libsbml.py.

def libsbml.XMLToken.hasAttr (   self,
  args 
) [inherited]

Python method signature(s):

hasAttr(self, int index)    bool
hasAttr(self, string name, string uri = "")    bool
hasAttr(self, string name)    bool
hasAttr(self, XMLTriple triple)    bool

Predicate returning true or false depending on whether an attribute with the given XML triple exists in the attribute set in this XMLToken

Parameters:
triple an 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.

Definition at line 27971 of file libsbml.py.

def libsbml.XMLToken.hasNamespaceNS (   self,
  args 
) [inherited]

Python method signature(s):

hasNamespaceNS(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:
uri a string, the uri for the namespace
prefix a 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.

Definition at line 28299 of file libsbml.py.

def libsbml.XMLToken.hasNamespacePrefix (   self,
  args 
) [inherited]

Python method signature(s):

hasNamespacePrefix(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:
prefix a 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.

Definition at line 28279 of file libsbml.py.

def libsbml.XMLToken.hasNamespaceURI (   self,
  args 
) [inherited]

Python method signature(s):

hasNamespaceURI(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:
uri a 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.

Definition at line 28259 of file libsbml.py.

def libsbml.XMLNode.insertChild (   self,
  args 
)

Python method signature(s):

insertChild(self, unsigned int 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:
n an integer, the index at which the given node is inserted
node an XMLNode to be inserted as nth child.
Returns:
a reference to the newly-inserted child node

Definition at line 28830 of file libsbml.py.

def libsbml.XMLToken.isAttributesEmpty (   self  )  [inherited]

Python method signature(s):

isAttributesEmpty(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.

Definition at line 27995 of file libsbml.py.

def libsbml.XMLToken.isElement (   self  )  [inherited]

Python method signature(s):

isElement(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.

Definition at line 28460 of file libsbml.py.

def libsbml.XMLToken.isEnd (   self  )  [inherited]

Python method signature(s):

isEnd(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.

Definition at line 28476 of file libsbml.py.

def libsbml.XMLToken.isEndFor (   self,
  args 
) [inherited]

Python method signature(s):

isEndFor(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:
element XMLToken, element for which query is made.
Returns:
true if this XMLToken is an XML end element for the given XMLToken start element, false otherwise.

Definition at line 28492 of file libsbml.py.

def libsbml.XMLToken.isEOF (   self  )  [inherited]

Python method signature(s):

isEOF(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.

Definition at line 28511 of file libsbml.py.

def libsbml.XMLToken.isNamespacesEmpty (   self  )  [inherited]

Python method signature(s):

isNamespacesEmpty(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.

Definition at line 28242 of file libsbml.py.

def libsbml.XMLToken.isStart (   self  )  [inherited]

Python method signature(s):

isStart(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.

Definition at line 28528 of file libsbml.py.

def libsbml.XMLToken.isText (   self  )  [inherited]

Python method signature(s):

isText(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.

Definition at line 28544 of file libsbml.py.

def libsbml.XMLToken.removeAttr (   self,
  args 
) [inherited]

Python method signature(s):

removeAttr(self, int n)    int
removeAttr(self, string name, string uri = "")    int
removeAttr(self, string name)    int
removeAttr(self, XMLTriple triple)    int

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:
triple an XMLTriple, the XML triple of the attribute.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION
  • LIBSBML_INDEX_EXCEEDS_SIZE

Definition at line 27771 of file libsbml.py.

def libsbml.XMLNode.removeChild (   self,
  args 
)

Python method signature(s):

removeChild(self, unsigned int 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 NULL).

Parameters:
n an integer, the index of the node to be removed
Returns:
the removed child, or NULL 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.

Definition at line 28853 of file libsbml.py.

def libsbml.XMLNode.removeChildren (   self  ) 

Python method signature(s):

removeChildren(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:
  • LIBSBML_OPERATION_SUCCESS

Definition at line 28880 of file libsbml.py.

def libsbml.XMLToken.removeNamespace (   self,
  args 
) [inherited]

Python method signature(s):

removeNamespace(self, int index)    int
removeNamespace(self, string prefix)    int

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

Parameters:
prefix a string, prefix of the required namespace.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION
  • LIBSBML_INDEX_EXCEEDS_SIZE

Definition at line 28092 of file libsbml.py.

def libsbml.XMLToken.setAttributes (   self,
  args 
) [inherited]

Python method signature(s):

setAttributes(self, XMLAttributes attributes)    int

Sets an XMLAttributes to this XMLToken. Nothing will be done if this XMLToken is not a start element.

Parameters:
attributes XMLAttributes to be set to this XMLToken.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION
Note:
This function replaces the existing XMLAttributes with the new one.

Definition at line 27714 of file libsbml.py.

def libsbml.XMLToken.setEnd (   self  )  [inherited]

Python method signature(s):

setEnd(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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED

Definition at line 28560 of file libsbml.py.

def libsbml.XMLToken.setEOF (   self  )  [inherited]

Python method signature(s):

setEOF(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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED

Definition at line 28580 of file libsbml.py.

def libsbml.XMLToken.setNamespaces (   self,
  args 
) [inherited]

Python method signature(s):

setNamespaces(self, XMLNamespaces namespaces)    int

Sets an XMLnamespaces to this XML element. Nothing will be done if this XMLToken is not a start element.

Parameters:
namespaces XMLNamespaces to be set to this XMLToken.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION
Note:
This function replaces the existing XMLNamespaces with the new one.

Definition at line 28027 of file libsbml.py.

def libsbml.XMLToken.setTriple (   self,
  args 
) [inherited]

Python method signature(s):

setTriple(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:
triple XMLTriple to be added to this XML element.
Returns:
integer value indicating success/failure of the function. The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_XML_OPERATION

Definition at line 28320 of file libsbml.py.

def libsbml.XMLToken.toString (   self  )  [inherited]

Python method signature(s):

toString(self)    string

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

Definition at line 28620 of file libsbml.py.

def libsbml.XMLNode.toXMLString (   self  ) 

Python method signature(s):

toXMLString(self)    string

Returns a string representation of this XMLNode.

Returns:
a string derived from this XMLNode.

Definition at line 28934 of file libsbml.py.

def libsbml.XMLToken.unsetEnd (   self  )  [inherited]

Python method signature(s):

unsetEnd(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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_OPERATION_FAILED

Definition at line 28600 of file libsbml.py.


Member Data Documentation

Reimplemented from libsbml.XMLToken.

Definition at line 28788 of file libsbml.py.




HTML documentation generated on Thu Jan 21 16:56:20 2010 using Doxygen 1.5.8.