libsbml.XMLToken Class Reference

Inheritance diagram for libsbml.XMLToken:

Inheritance graph
[legend]

List of all members.


Detailed Description

Representation of a token in an XML stream.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

Definition at line 27639 of file libsbml.py.


Public Member Functions

def __eq__
def __init__
def __ne__
def addAttr
def addNamespace
def append
def clearAttributes
def clearNamespaces
def clone
def getAttributes
def getAttributesLength
def getAttrIndex
def getAttrName
def getAttrPrefix
def getAttrPrefixedName
def getAttrURI
def getAttrValue
def getCharacters
def getColumn
def getLine
def getName
def getNamespaceIndex
def getNamespaceIndexByPrefix
def getNamespacePrefix
def getNamespaces
def getNamespacesLength
def getNamespaceURI
def getPrefix
def getURI
def hasAttr
def hasNamespaceNS
def hasNamespacePrefix
def hasNamespaceURI
def isAttributesEmpty
def isElement
def isEnd
def isEndFor
def isEOF
def isNamespacesEmpty
def isStart
def isText
def removeAttr
def removeNamespace
def setAttributes
def setEnd
def setEOF
def setNamespaces
def setTriple
def toString
def unsetEnd

Public Attributes

 this

Member Function Documentation

def libsbml.XMLToken.__eq__ (   self,
  rhs 
)

Definition at line 28634 of file libsbml.py.

def libsbml.XMLToken.__init__ (   self,
  args 
)

Python method signature(s):

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

Copy constructor; creates a copy of this XMLToken.

Reimplemented in libsbml.XMLNode.

Definition at line 27654 of file libsbml.py.

def libsbml.XMLToken.__ne__ (   self,
  rhs 
)

Definition at line 28641 of file libsbml.py.

def libsbml.XMLToken.addAttr (   self,
  args 
)

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.XMLToken.addNamespace (   self,
  args 
)

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 
)

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  ) 

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  ) 

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.XMLToken.clone (   self  ) 

Python method signature(s):

clone(self)    XMLToken

Creates and returns a deep copy of this XMLToken.

Returns:
a (deep) copy of this XMLToken set.

Reimplemented in libsbml.XMLNode.

Definition at line 27684 of file libsbml.py.

def libsbml.XMLToken.getAttributes (   self  ) 

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  ) 

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 
)

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 
)

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 
)

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 
)

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 
)

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 
)

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  ) 

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.XMLToken.getColumn (   self  ) 

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  ) 

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  ) 

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 
)

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 
)

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 
)

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  ) 

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  ) 

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 
)

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.XMLToken.getPrefix (   self  ) 

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  ) 

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 
)

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 
)

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 
)

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 
)

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.XMLToken.isAttributesEmpty (   self  ) 

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  ) 

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  ) 

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 
)

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  ) 

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  ) 

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  ) 

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  ) 

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 
)

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.XMLToken.removeNamespace (   self,
  args 
)

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 
)

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  ) 

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  ) 

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 
)

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 
)

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  ) 

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.XMLToken.unsetEnd (   self  ) 

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 in libsbml.XMLNode.

Definition at line 27683 of file libsbml.py.




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