libSBML C# API  5.18.0
libsbmlcs.XMLNode Class Reference
Inheritance diagram for libsbmlcs.XMLNode:
[legend]

Detailed Description

A node in libSBML's XML document tree.

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., "<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:

Public Member Functions

int addAttr (string name, string value, string namespaceURI, string prefix)
 Adds an attribute to the XML element represented by this token. More...
 
int addAttr (string name, string value, string namespaceURI)
 Adds an attribute to the XML element represented by this token. More...
 
int addAttr (string name, string value)
 Adds an attribute to the XML element represented by this token. More...
 
int addAttr (XMLTriple triple, string value)
 Adds an attribute to the XML element represented by this token. More...
 
int addChild (XMLNode node)
 Adds a copy of node as a child of this XMLNode. More...
 
int addNamespace (string uri, string prefix)
 Appends an XML namespace declaration to this token. More...
 
int addNamespace (string uri)
 Appends an XML namespace declaration to this token. More...
 
int append (string chars)
 Appends characters to the text content of token. More...
 
int clearAttributes ()
 Removes all attributes of this XMLToken object. More...
 
int clearNamespaces ()
 Removes all XML namespace declarations from this token. More...
 
new XMLNode clone ()
 Creates and returns a deep copy of this XMLNode object. More...
 
override void Dispose ()
 
override bool Equals (Object sb)
 
bool equals (XMLNode other, bool ignoreURI, bool ignoreAttributeValues)
 Compare this XMLNode against another XMLNode returning true if both nodes represent the same XML tree, or false otherwise. More...
 
bool equals (XMLNode other, bool ignoreURI)
 Compare this XMLNode against another XMLNode returning true if both nodes represent the same XML tree, or false otherwise. More...
 
bool equals (XMLNode other)
 Compare this XMLNode against another XMLNode returning true if both nodes represent the same XML tree, or false otherwise. More...
 
XMLAttributes getAttributes ()
 Returns the attributes of the XML element represented by this token. More...
 
int getAttributesLength ()
 Returns the number of attributes on this XMLToken object. More...
 
int getAttrIndex (string name, string uri)
 Returns the index of the attribute with the given name and namespace URI. More...
 
int getAttrIndex (string name)
 Returns the index of the attribute with the given name and namespace URI. More...
 
int getAttrIndex (XMLTriple triple)
 Returns the index of the attribute defined by the given XMLTriple object. More...
 
string getAttrName (int index)
 Returns the name of the nth attribute in this token's list of attributes. More...
 
string getAttrPrefix (int index)
 Returns the prefix of the nth attribute in this token's list of attributes. More...
 
string getAttrPrefixedName (int index)
 Returns the prefixed name of the nth attribute in this token's list of attributes. More...
 
string getAttrURI (int index)
 Returns the XML namespace URI of the nth attribute in this token's list of attributes. More...
 
string getAttrValue (int index)
 Returns the value of the nth attribute in this token's list of attributes. More...
 
string getAttrValue (string name, string uri)
 Returns the value of the attribute with a given name and XML namespace URI. More...
 
string getAttrValue (string name)
 Returns the value of the attribute with a given name and XML namespace URI. More...
 
string getAttrValue (XMLTriple triple)
 Returns the value of the attribute specified by a given XMLTriple object. More...
 
string getCharacters ()
 Returns the character text of token. More...
 
XMLNode getChild (long n)
 Returns the. More...
 
XMLNode getChild (string name)
 Returns the first child of this XMLNode with the corresponding name. More...
 
long getColumn ()
 Returns the column number at which this token occurs in the input. More...
 
override int GetHashCode ()
 
int getIndex (string name)
 Return the index of the first child of this XMLNode with the given name. More...
 
long getLine ()
 Returns the line number at which this token occurs in the input. More...
 
string getName ()
 Returns the (unqualified) name of token. More...
 
int getNamespaceIndex (string uri)
 Returns the index of an XML namespace declaration based on its URI. More...
 
int getNamespaceIndexByPrefix (string prefix)
 Returns the index of an XML namespace declaration based on its prefix. More...
 
string getNamespacePrefix (int index)
 Returns the prefix of the nth XML namespace declaration. More...
 
string getNamespacePrefix (string uri)
 Returns the prefix associated with a given XML namespace URI on this token. More...
 
XMLNamespaces getNamespaces ()
 Returns the XML namespaces declared for this token. More...
 
int getNamespacesLength ()
 Returns the number of XML namespaces declared on this token. More...
 
string getNamespaceURI (int index)
 Returns the URI of the nth XML namespace declared on this token. More...
 
string getNamespaceURI (string prefix)
 Returns the URI of an XML namespace with a given prefix. More...
 
string getNamespaceURI ()
 Returns the URI of an XML namespace with a given prefix. More...
 
long getNumChildren ()
 Returns the number of children for this XMLNode. More...
 
string getPrefix ()
 Returns the XML namespace prefix of token. More...
 
string getURI ()
 Returns the XML namespace URI of token. More...
 
bool hasAttr (int index)
 Returns true if an attribute with the given index exists. More...
 
bool hasAttr (string name, string uri)
 Returns true if an attribute with a given name and namespace URI exists. More...
 
bool hasAttr (string name)
 Returns true if an attribute with a given name and namespace URI exists. More...
 
bool hasAttr (XMLTriple triple)
 Returns true if an attribute defined by a given XMLTriple object exists. More...
 
bool hasChild (string name)
 Return a boolean indicating whether this XMLNode has a child with the given name. More...
 
bool hasNamespaceNS (string uri, string prefix)
 Returns true if this token has an XML namespace with a given prefix and URI combination. More...
 
bool hasNamespacePrefix (string prefix)
 Returns true if this token has an XML namespace with a given prefix. More...
 
bool hasNamespaceURI (string uri)
 Returns true if this token has an XML namespace with a given URI. More...
 
XMLNode insertChild (long n, XMLNode node)
 Inserts a copy of the given node as the. More...
 
bool isAttributesEmpty ()
 Returns true if this token has no attributes. More...
 
bool isElement ()
 Returns true if this token represents an XML element. More...
 
bool isEnd ()
 Returns true if this token represents an XML end element. More...
 
bool isEndFor (XMLToken element)
 Returns true if this token represents an XML end element for a particular start element. More...
 
bool isEOF ()
 Returns true if this token is an end of file marker. More...
 
bool isNamespacesEmpty ()
 Returns true if there are no namespaces declared on this token. More...
 
bool isStart ()
 Returns true if this token represents an XML start element. More...
 
bool isText ()
 Returns true if this token represents an XML text element. More...
 
int removeAttr (int n)
 Removes the nth attribute from the XML element represented by this token. More...
 
int removeAttr (string name, string uri)
 Removes an attribute from the XML element represented by this token. More...
 
int removeAttr (string name)
 Removes an attribute from the XML element represented by this token. More...
 
int removeAttr (XMLTriple triple)
 Removes an attribute from the XML element represented by this token. More...
 
XMLNode removeChild (long n)
 Removes the. More...
 
int removeChildren ()
 Removes all children from this node. More...
 
int removeNamespace (int index)
 Removes the nth XML namespace declaration. More...
 
int removeNamespace (string prefix)
 Removes an XML namespace declaration having a given prefix. More...
 
int setAttributes (XMLAttributes attributes)
 Sets the attributes on the XML element represented by this token. More...
 
int setCharacters (string chars)
 Sets the characters for this XMLToken. More...
 
int setEnd ()
 Declares that this token represents an XML element end tag. More...
 
int setEOF ()
 Declares that this token is an end-of-file/input marker. More...
 
int setNamespaces (XMLNamespaces namespaces)
 Sets the XML namespaces on this XML element. More...
 
int setTriple (XMLTriple triple)
 Sets the name, namespace prefix and namespace URI of this token. More...
 
string toString ()
 Prints a string representation of the underlying token stream. More...
 
string toXMLString ()
 Returns a string representation of this XMLNode. More...
 
int unsetEnd ()
 Declares that this token no longer represents an XML start/end element. More...
 
void writeToStream (XMLOutputStream stream)
 
 XMLNode ()
 Creates a new empty XMLNode with no children. More...
 
 XMLNode (XMLToken token)
 Creates a new XMLNode by copying an XMLToken object. More...
 
 XMLNode (XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line, long column)
 Creates a new start element XMLNode with the given set of attributes and namespace declarations. More...
 
 XMLNode (XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line)
 Creates a new start element XMLNode with the given set of attributes and namespace declarations. More...
 
 XMLNode (XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces)
 Creates a new start element XMLNode with the given set of attributes and namespace declarations. More...
 
 XMLNode (XMLTriple triple, XMLAttributes attributes, long line, long column)
 Creates a start element XMLNode with the given set of attributes. More...
 
 XMLNode (XMLTriple triple, XMLAttributes attributes, long line)
 Creates a start element XMLNode with the given set of attributes. More...
 
 XMLNode (XMLTriple triple, XMLAttributes attributes)
 Creates a start element XMLNode with the given set of attributes. More...
 
 XMLNode (XMLTriple triple, long line, long column)
 Creates an end element XMLNode. More...
 
 XMLNode (XMLTriple triple, long line)
 Creates an end element XMLNode. More...
 
 XMLNode (XMLTriple triple)
 Creates an end element XMLNode. More...
 
 XMLNode (string chars, long line, long column)
 Creates a text XMLNode. More...
 
 XMLNode (string chars, long line)
 Creates a text XMLNode. More...
 
 XMLNode (string chars)
 Creates a text XMLNode. More...
 
 XMLNode (XMLInputStream stream)
 
 XMLNode (XMLNode orig)
 Copy constructor; creates a copy of this XMLNode. More...
 

Static Public Member Functions

static XMLNode convertStringToXMLNode (string xmlstr, XMLNamespaces xmlns)
 Returns an XMLNode which is derived from a string containing XML content. More...
 
static XMLNode convertStringToXMLNode (string xmlstr)
 Returns an XMLNode which is derived from a string containing XML content. More...
 
static string convertXMLNodeToString (XMLNode node)
 Returns a string representation of a given XMLNode. More...
 
static bool operator!= (XMLToken lhs, XMLToken rhs)
 
static bool operator!= (XMLNode lhs, XMLNode rhs)
 
static bool operator== (XMLToken lhs, XMLToken rhs)
 
static bool operator== (XMLNode lhs, XMLNode rhs)
 

Protected Attributes

bool swigCMemOwn
 

Constructor & Destructor Documentation

libsbmlcs.XMLNode.XMLNode ( )

Creates a new empty XMLNode with no children.

libsbmlcs.XMLNode.XMLNode ( XMLToken  token)

Creates a new XMLNode by copying an XMLToken object.

Parameters
tokenXMLToken to be copied to XMLNode.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple,
XMLAttributes  attributes,
XMLNamespaces  namespaces,
long  line,
long  column 
)

Creates a new start element XMLNode with the given set of attributes and namespace declarations.

Parameters
tripleXMLTriple.
attributesXMLAttributes, the attributes to set.
namespacesXMLNamespaces, the namespaces to set.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple,
XMLAttributes  attributes,
XMLNamespaces  namespaces,
long  line 
)

Creates a new start element XMLNode with the given set of attributes and namespace declarations.

Parameters
tripleXMLTriple.
attributesXMLAttributes, the attributes to set.
namespacesXMLNamespaces, the namespaces to set.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple,
XMLAttributes  attributes,
XMLNamespaces  namespaces 
)

Creates a new start element XMLNode with the given set of attributes and namespace declarations.

Parameters
tripleXMLTriple.
attributesXMLAttributes, the attributes to set.
namespacesXMLNamespaces, the namespaces to set.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple,
XMLAttributes  attributes,
long  line,
long  column 
)

Creates a start element XMLNode with the given set of attributes.

Parameters
tripleXMLTriple.
attributesXMLAttributes, the attributes to set.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple,
XMLAttributes  attributes,
long  line 
)

Creates a start element XMLNode with the given set of attributes.

Parameters
tripleXMLTriple.
attributesXMLAttributes, the attributes to set.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple,
XMLAttributes  attributes 
)

Creates a start element XMLNode with the given set of attributes.

Parameters
tripleXMLTriple.
attributesXMLAttributes, the attributes to set.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple,
long  line,
long  column 
)

Creates an end element XMLNode.

Parameters
tripleXMLTriple.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple,
long  line 
)

Creates an end element XMLNode.

Parameters
tripleXMLTriple.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLTriple  triple)

Creates an end element XMLNode.

Parameters
tripleXMLTriple.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( string  chars,
long  line,
long  column 
)

Creates a text XMLNode.

Parameters
charsa string, the text to be added to the XMLToken.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( string  chars,
long  line 
)

Creates a text XMLNode.

Parameters
charsa string, the text to be added to the XMLToken.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( string  chars)

Creates a text XMLNode.

Parameters
charsa string, the text to be added to the XMLToken.
linea long integer, the line number (default = 0).
columna long integer, the column number (default = 0).
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.
libsbmlcs.XMLNode.XMLNode ( XMLInputStream  stream)
libsbmlcs.XMLNode.XMLNode ( XMLNode  orig)

Copy constructor; creates a copy of this XMLNode.

Parameters
origthe XMLNode instance to copy.

Member Function Documentation

int libsbmlcs.XMLToken.addAttr ( string  name,
string  value,
string  namespaceURI,
string  prefix 
)
inherited

Adds an attribute to the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
namea string, the so-called 'local part' of the attribute name; that is, the attribute name without any namespace qualifier or prefix.
valuea string, the value assigned to the attribute.
namespaceURIa string, the XML namespace URI of the attribute.
prefixa string, the prefix for the XML namespace.

Recall that in XML, the complete form of an attribute on an XML element is the following:

prefix:name='value'

The name part is the name of the attribute, the 'value' part is the value assigned to the attribute (and it is always a quoted string), and the prefix part is an optional XML namespace prefix. Internally in libSBML, this data is stored in an XMLAttributes object associated with this XMLToken.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
If an attribute with the same name and XML namespace URI already exists on this XMLToken object, then the previous value will be replaced with the new value provided to this method.
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.
int libsbmlcs.XMLToken.addAttr ( string  name,
string  value,
string  namespaceURI 
)
inherited

Adds an attribute to the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
namea string, the so-called 'local part' of the attribute name; that is, the attribute name without any namespace qualifier or prefix.
valuea string, the value assigned to the attribute.
namespaceURIa string, the XML namespace URI of the attribute.
prefixa string, the prefix for the XML namespace.

Recall that in XML, the complete form of an attribute on an XML element is the following:

prefix:name='value'

The name part is the name of the attribute, the 'value' part is the value assigned to the attribute (and it is always a quoted string), and the prefix part is an optional XML namespace prefix. Internally in libSBML, this data is stored in an XMLAttributes object associated with this XMLToken.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
If an attribute with the same name and XML namespace URI already exists on this XMLToken object, then the previous value will be replaced with the new value provided to this method.
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.
int libsbmlcs.XMLToken.addAttr ( string  name,
string  value 
)
inherited

Adds an attribute to the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
namea string, the so-called 'local part' of the attribute name; that is, the attribute name without any namespace qualifier or prefix.
valuea string, the value assigned to the attribute.
namespaceURIa string, the XML namespace URI of the attribute.
prefixa string, the prefix for the XML namespace.

Recall that in XML, the complete form of an attribute on an XML element is the following:

prefix:name='value'

The name part is the name of the attribute, the 'value' part is the value assigned to the attribute (and it is always a quoted string), and the prefix part is an optional XML namespace prefix. Internally in libSBML, this data is stored in an XMLAttributes object associated with this XMLToken.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
If an attribute with the same name and XML namespace URI already exists on this XMLToken object, then the previous value will be replaced with the new value provided to this method.
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.
int libsbmlcs.XMLToken.addAttr ( XMLTriple  triple,
string  value 
)
inherited

Adds an attribute to the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
triplean XMLTriple object defining the attribute, its value, and optionally its XML namespace (if any is provided).
valuea string, the value assigned to the attribute.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
If an attribute with the same name and XML namespace URI already exists on this XMLToken object, then the previous value will be replaced with the new value provided to this method.
int libsbmlcs.XMLNode.addChild ( XMLNode  node)

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.
int libsbmlcs.XMLToken.addNamespace ( string  uri,
string  prefix 
)
inherited

Appends an XML namespace declaration to this token.

The namespace added will be defined by the given XML namespace URI and an optional prefix. If this XMLToken object already possesses an XML namespace declaration with the given prefix, then the existing XML namespace URI will be overwritten by the new one given by uri.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
uria string, the XML namespace URI for the namespace.
prefixa string, the namespace prefix to use.
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.
int libsbmlcs.XMLToken.addNamespace ( string  uri)
inherited

Appends an XML namespace declaration to this token.

The namespace added will be defined by the given XML namespace URI and an optional prefix. If this XMLToken object already possesses an XML namespace declaration with the given prefix, then the existing XML namespace URI will be overwritten by the new one given by uri.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
uria string, the XML namespace URI for the namespace.
prefixa string, the namespace prefix to use.
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.
int libsbmlcs.XMLToken.append ( string  chars)
inherited

Appends characters to the text content of token.

This method only makes sense for XMLToken objects that contains text. If this method is called on a token that represents an XML start or end tag, it will return the code LIBSBML_OPERATION_FAILED.

Parameters
charsstring, characters to append to the text of this token.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
isText()
isElement()
int libsbmlcs.XMLToken.clearAttributes ( )
inherited

Removes all attributes of this XMLToken object.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

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

Removes all XML namespace declarations from this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

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

Creates and returns a deep copy of this XMLNode object.

Returns
the (deep) copy of this XMLNode object.
static XMLNode libsbmlcs.XMLNode.convertStringToXMLNode ( string  xmlstr,
XMLNamespaces  xmlns 
)
static

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 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>, 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 null.
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.
static XMLNode libsbmlcs.XMLNode.convertStringToXMLNode ( string  xmlstr)
static

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 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>, 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 null.
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.
static string libsbmlcs.XMLNode.convertXMLNodeToString ( XMLNode  node)
static

Returns a string representation of a given XMLNode.

Parameters
nodethe XMLNode to be represented as a string.
Returns
a string-form representation of node.
override void libsbmlcs.XMLNode.Dispose ( )
virtual

Reimplemented from libsbmlcs.XMLToken.

override bool libsbmlcs.XMLNode.Equals ( Object  sb)
bool libsbmlcs.XMLNode.equals ( XMLNode  other,
bool  ignoreURI,
bool  ignoreAttributeValues 
)

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.
ignoreAttributeValueswhetehr to ignore attribute values when doing the comparison.
Returns
boolean indicating whether this XMLNode represents the same XML tree as another.
bool libsbmlcs.XMLNode.equals ( XMLNode  other,
bool  ignoreURI 
)

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.
ignoreAttributeValueswhetehr to ignore attribute values when doing the comparison.
Returns
boolean indicating whether this XMLNode represents the same XML tree as another.
bool libsbmlcs.XMLNode.equals ( XMLNode  other)

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.
ignoreAttributeValueswhetehr to ignore attribute values when doing the comparison.
Returns
boolean indicating whether this XMLNode represents the same XML tree as another.
XMLAttributes libsbmlcs.XMLToken.getAttributes ( )
inherited

Returns the attributes of the XML element represented by this token.

Returns
the attributes of this XML element, stored in an XMLAttributes object.
int libsbmlcs.XMLToken.getAttributesLength ( )
inherited

Returns the number of attributes on this XMLToken object.

Returns
the number of attributes possessed by this token.
See also
hasAttr()
int libsbmlcs.XMLToken.getAttrIndex ( string  name,
string  uri 
)
inherited

Returns the index of the attribute with the given name and namespace URI.

Parameters
namea string, the 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 it is not present on this token.
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.
int libsbmlcs.XMLToken.getAttrIndex ( string  name)
inherited

Returns the index of the attribute with the given name and namespace URI.

Parameters
namea string, the 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 it is not present on this token.
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.
int libsbmlcs.XMLToken.getAttrIndex ( XMLTriple  triple)
inherited

Returns the index of the attribute defined by the given XMLTriple object.

Parameters
triplethe XMLTriple object that defines the attribute whose index is being sought.
Returns
the index of an attribute with the given XMLTriple object, or -1 if no such attribute is present on this token.
string libsbmlcs.XMLToken.getAttrName ( int  index)
inherited

Returns the name of the nth attribute in this token's list of attributes.

Parameters
indexan integer, the position of the attribute whose name is being sought.
Returns
the name of the attribute located at position n in the list of attributes possessed by this XMLToken object.
Note
If index is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
See also
hasAttr()
getAttributesLength()
string libsbmlcs.XMLToken.getAttrPrefix ( int  index)
inherited

Returns the prefix of the nth attribute in this token's list of attributes.

Parameters
indexan integer, the position of the attribute whose prefix is being sought.
Returns
the XML namespace prefix of the attribute located at position n in the list of attributes possessed by this XMLToken object.
Note
If index is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
See also
hasAttr()
getAttributesLength()
string libsbmlcs.XMLToken.getAttrPrefixedName ( int  index)
inherited

Returns the prefixed name of the nth attribute in this token's list of attributes.

In this context, prefixed name means the name of the attribute prefixed with the XML namespace prefix assigned to the attribute. This will be a string of the form prefix:name.

Parameters
indexan integer, the position of the attribute whose prefixed name is being sought.
Returns
the prefixed name of the attribute located at position n in the list of attributes possessed by this XMLToken object.
Note
If index is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
string libsbmlcs.XMLToken.getAttrURI ( int  index)
inherited

Returns the XML namespace URI of the nth attribute in this token's list of attributes.

Parameters
indexan integer, the position of the attribute whose namespace URI is being sought.
Returns
the XML namespace URI of the attribute located at position n in the list of attributes possessed by this XMLToken object.
Note
If index is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
string libsbmlcs.XMLToken.getAttrValue ( int  index)
inherited

Returns the value of the nth attribute in this token's list of attributes.

Parameters
indexan integer, the position of the attribute whose value is required.
Returns
the value of the attribute located at position n in the list of attributes possessed by this XMLToken object.
Note
If index is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
string libsbmlcs.XMLToken.getAttrValue ( string  name,
string  uri 
)
inherited

Returns the value of the attribute with a given name and XML namespace URI.

Parameters
namea string, the name of the attribute whose value is being sought.
uria string, the XML namespace URI of the attribute.
Returns
The value of the attribute, as a string.
Note
If an attribute with the given name and uri does not exist on this token object, this method will return an empty string. XMLToken::hasAttr() can be used to test explicitly for the presence of an attribute with a given name and namespace.
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.
string libsbmlcs.XMLToken.getAttrValue ( string  name)
inherited

Returns the value of the attribute with a given name and XML namespace URI.

Parameters
namea string, the name of the attribute whose value is being sought.
uria string, the XML namespace URI of the attribute.
Returns
The value of the attribute, as a string.
Note
If an attribute with the given name and uri does not exist on this token object, this method will return an empty string. XMLToken::hasAttr() can be used to test explicitly for the presence of an attribute with a given name and namespace.
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.
string libsbmlcs.XMLToken.getAttrValue ( XMLTriple  triple)
inherited

Returns the value of the attribute specified by a given XMLTriple object.

Parameters
triplean XMLTriple describing the attribute whose value is being sought.
Returns
The value of the attribute, as a string.
Note
If an attribute defined by the given triple does not exist on this token object, this method will return an empty string. XMLToken::hasAttr() can be used to test explicitly for the existence of an attribute with the properties of a given triple.
string libsbmlcs.XMLToken.getCharacters ( )
inherited

Returns the character text of token.

Returns
the characters of this XML token. If this token is not a text token (i.e., it's an XML element and not character content), then this will return an empty string.
See also
isText()
isElement()
XMLNode libsbmlcs.XMLNode.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.
XMLNode libsbmlcs.XMLNode.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.
long libsbmlcs.XMLToken.getColumn ( )
inherited

Returns the column number at which this token occurs in the input.

Returns
the column at which this XMLToken occurred.
override int libsbmlcs.XMLNode.GetHashCode ( )
int libsbmlcs.XMLNode.getIndex ( string  name)

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.
long libsbmlcs.XMLToken.getLine ( )
inherited

Returns the line number at which this token occurs in the input.

Returns
the line at which this XMLToken occurred.
string libsbmlcs.XMLToken.getName ( )
inherited

Returns the (unqualified) name of token.

Returns
the (unqualified) name of token.
int libsbmlcs.XMLToken.getNamespaceIndex ( string  uri)
inherited

Returns the index of an XML namespace declaration based on its URI.

Parameters
uria string, the XML namespace URI of the sought-after namespace.
Returns
the index of the given declaration, or -1 if no such namespace URI is present on this XMLToken object.
int libsbmlcs.XMLToken.getNamespaceIndexByPrefix ( string  prefix)
inherited

Returns the index of an XML namespace declaration based on its prefix.

Parameters
prefixa string, the prefix of the sought-after XML namespace.
Returns
the index of the given declaration, or -1 if no such namespace URI is present on this XMLToken object.
string libsbmlcs.XMLToken.getNamespacePrefix ( int  index)
inherited

Returns the prefix of the nth XML namespace declaration.

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, this method will return an empty string. XMLToken::getNamespacesLength() can be used to find out how many namespaces are defined on this XMLToken object.
See also
getNamespacesLength()
string libsbmlcs.XMLToken.getNamespacePrefix ( string  uri)
inherited

Returns the prefix associated with a given XML namespace URI on this token.

Parameters
uria string, the URI of the namespace whose prefix is being sought.
Returns
the prefix of an XML namespace declaration on this XMLToken object.
Note
If there is no XML namespace with the given uri declared on this XMLToken object, this method will return an empty string.
XMLNamespaces libsbmlcs.XMLToken.getNamespaces ( )
inherited

Returns the XML namespaces declared for this token.

Returns
the XML namespace declarations for this XML element.
int libsbmlcs.XMLToken.getNamespacesLength ( )
inherited

Returns the number of XML namespaces declared on this token.

Returns
the number of XML namespaces stored in the XMLNamespaces object of this XMLToken object.
string libsbmlcs.XMLToken.getNamespaceURI ( int  index)
inherited

Returns the URI of the nth XML namespace declared on this token.

Parameters
indexan integer, the position of the sought-after XML namespace URI.
Returns
the URI of the nth XML namespace stored in the XMLNamespaces object in this XMLToken object.
Note
If index is out of range, this method will return an empty string.
See also
getNamespacesLength()
string libsbmlcs.XMLToken.getNamespaceURI ( string  prefix)
inherited

Returns the URI of an XML namespace with a given prefix.

Parameters
prefixa string, the prefix of the sought-after XML namespace URI.
Returns
the URI of an XML namespace declaration given its prefix.
Note
If there is no XML namespace with the given prefix stored in the XMLNamespaces object of this XMLToken object, this method will return an empty string.
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.
string libsbmlcs.XMLToken.getNamespaceURI ( )
inherited

Returns the URI of an XML namespace with a given prefix.

Parameters
prefixa string, the prefix of the sought-after XML namespace URI.
Returns
the URI of an XML namespace declaration given its prefix.
Note
If there is no XML namespace with the given prefix stored in the XMLNamespaces object of this XMLToken object, this method will return an empty string.
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.
long libsbmlcs.XMLNode.getNumChildren ( )

Returns the number of children for this XMLNode.

Returns
the number of children for this XMLNode.
string libsbmlcs.XMLToken.getPrefix ( )
inherited

Returns the XML namespace prefix of token.

Returns
the XML namespace prefix of token.
Note
If no XML namespace prefix has been assigned to this token, this method will return an empty string.
string libsbmlcs.XMLToken.getURI ( )
inherited

Returns the XML namespace URI of token.

Returns
the XML namespace URI of token.
bool libsbmlcs.XMLToken.hasAttr ( int  index)
inherited

Returns true if an attribute with the given index exists.

Parameters
indexan integer, the position of the attribute.
Returns
true if this token object possesses an attribute with the given index, false otherwise.
bool libsbmlcs.XMLToken.hasAttr ( string  name,
string  uri 
)
inherited

Returns true if an attribute with a given name and namespace URI exists.

Parameters
namea string, the name of the attribute being sought.
uria string, the XML namespace URI of the attribute being sought.
Returns
true if an attribute with the given local name and namespace URI exists in the list of attributes on this token object, 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.
bool libsbmlcs.XMLToken.hasAttr ( string  name)
inherited

Returns true if an attribute with a given name and namespace URI exists.

Parameters
namea string, the name of the attribute being sought.
uria string, the XML namespace URI of the attribute being sought.
Returns
true if an attribute with the given local name and namespace URI exists in the list of attributes on this token object, 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.
bool libsbmlcs.XMLToken.hasAttr ( XMLTriple  triple)
inherited

Returns true if an attribute defined by a given XMLTriple object exists.

Parameters
triplean XMLTriple object describing the attribute being sought.
Returns
true if an attribute matching the properties of the given XMLTriple object exists in the list of attributes on this token, false otherwise.
bool libsbmlcs.XMLNode.hasChild ( string  name)

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.
bool libsbmlcs.XMLToken.hasNamespaceNS ( string  uri,
string  prefix 
)
inherited

Returns true if this token has an XML namespace with a given prefix and URI combination.

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 object of this XMLToken object, false otherwise.
bool libsbmlcs.XMLToken.hasNamespacePrefix ( string  prefix)
inherited

Returns true if this token has an XML namespace with a given prefix.

Parameters
prefixa string, the prefix for the XML namespace.
Returns
true if an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken, false otherwise.
bool libsbmlcs.XMLToken.hasNamespaceURI ( string  uri)
inherited

Returns true if this token has an XML namespace with a given URI.

Parameters
uria string, the URI of the XML namespace.
Returns
true if an XML namespace with the given URI is contained in the XMLNamespaces object of this XMLToken object, false otherwise.
XMLNode libsbmlcs.XMLNode.insertChild ( long  n,
XMLNode  node 
)

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.
bool libsbmlcs.XMLToken.isAttributesEmpty ( )
inherited

Returns true if this token has no attributes.

Returns
true if the list of attributes on XMLToken object is empty, false otherwise.
bool libsbmlcs.XMLToken.isElement ( )
inherited

Returns true if this token represents an XML element.

This generic predicate returns true if the element is either a start or end tag, and false if it's a text object. The related methods XMLToken:isStart(), XMLToken::isEnd() and XMLToken::isText() are more specific predicates.

Returns
true if this XMLToken object represents an XML element, false otherwise.
See also
isStart()
isEnd()
isText()
bool libsbmlcs.XMLToken.isEnd ( )
inherited

Returns true if this token represents an XML end element.

Returns
true if this XMLToken object represents an XML end element, false otherwise.
See also
isStart()
isElement()
isText()
bool libsbmlcs.XMLToken.isEndFor ( XMLToken  element)
inherited

Returns true if this token represents an XML end element for a particular start element.

Parameters
elementXMLToken, the element with which the current object should be compared to determined whether the current object is a start element for the given one.
Returns
true if this XMLToken object represents an XML end tag for the start tag given by element, false otherwise.
See also
isElement()
isStart()
isEnd()
isText()
bool libsbmlcs.XMLToken.isEOF ( )
inherited

Returns true if this token is an end of file marker.

Returns
true if this XMLToken object represents the end of the input, false otherwise.
See also
setEOF()
bool libsbmlcs.XMLToken.isNamespacesEmpty ( )
inherited

Returns true if there are no namespaces declared on this token.

Returns
true if the XMLNamespaces object stored in this XMLToken token is empty, false otherwise.
bool libsbmlcs.XMLToken.isStart ( )
inherited

Returns true if this token represents an XML start element.

Returns
true if this XMLToken is an XML start element, false otherwise.
See also
isElement()
isEnd()
isText()
bool libsbmlcs.XMLToken.isText ( )
inherited

Returns true if this token represents an XML text element.

Returns
true if this XMLToken is an XML text element, false otherwise.
See also
isElement()
isStart()
isEnd()
static bool libsbmlcs.XMLToken.operator!= ( XMLToken  lhs,
XMLToken  rhs 
)
staticinherited
static bool libsbmlcs.XMLNode.operator!= ( XMLNode  lhs,
XMLNode  rhs 
)
static
static bool libsbmlcs.XMLToken.operator== ( XMLToken  lhs,
XMLToken  rhs 
)
staticinherited
static bool libsbmlcs.XMLNode.operator== ( XMLNode  lhs,
XMLNode  rhs 
)
static
int libsbmlcs.XMLToken.removeAttr ( int  n)
inherited

Removes the nth attribute from the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML 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: The value LIBSBML_INDEX_EXCEEDS_SIZE is returned if there is no attribute on this element at the given index n.
See also
getAttrIndex(XMLTriple triple)
getAttrIndex(string name, string uri)
getAttributesLength()
int libsbmlcs.XMLToken.removeAttr ( string  name,
string  uri 
)
inherited

Removes an attribute from the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
namea string, the name of the attribute to be removed.
uria string, the XML namespace URI of the attribute to be removed.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are: The value LIBSBML_INDEX_EXCEEDS_SIZE is returned if there is no attribute on this element with the given name (and uri if specified).
See also
hasAttr(string name, string uri)
int libsbmlcs.XMLToken.removeAttr ( string  name)
inherited

Removes an attribute from the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
namea string, the name of the attribute to be removed.
uria string, the XML namespace URI of the attribute to be removed.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are: The value LIBSBML_INDEX_EXCEEDS_SIZE is returned if there is no attribute on this element with the given name (and uri if specified).
See also
hasAttr(string name, string uri)
int libsbmlcs.XMLToken.removeAttr ( XMLTriple  triple)
inherited

Removes an attribute from the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
triplean XMLTriple describing the attribute to be removed.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are: The value LIBSBML_INDEX_EXCEEDS_SIZE is returned if there is no attribute on this element matching the properties of the given triple.
See also
hasAttr(XMLTriple triple)
XMLNode libsbmlcs.XMLNode.removeChild ( long  n)

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
nan 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.
int libsbmlcs.XMLNode.removeChildren ( )

Removes all children from this node.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
int libsbmlcs.XMLToken.removeNamespace ( int  index)
inherited

Removes the nth XML namespace declaration.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
indexan integer, the position of the namespace to be removed. The position in this context refers to the position of the namespace in the XMLNamespaces object stored in this XMLToken object. Callers can use one of the getNamespace___() methods to find the index number of a given namespace.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
getNamespaceIndex()
getNamespaceIndexByPrefix()
getNamespacesLength()
int libsbmlcs.XMLToken.removeNamespace ( string  prefix)
inherited

Removes an XML namespace declaration having a given prefix.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
prefixa string, the prefix of the namespace to be removed.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are: The value LIBSBML_INDEX_EXCEEDS_SIZE is returned if there is no namespace with the given prefix on this element.
See also
getNamespaceIndexByPrefix()
int libsbmlcs.XMLToken.setAttributes ( XMLAttributes  attributes)
inherited

Sets the attributes on the XML element represented by this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
attributesan XMLAttributes object to be assigned to this XMLToken object, thereby setting the XML attributes associated with this token.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
This function replaces any existing XMLAttributes object on this XMLToken object with the one given by attributes.
int libsbmlcs.XMLToken.setCharacters ( string  chars)
inherited

Sets the characters for this XMLToken.

This method only makes sense for XMLToken objects that contains text. If this method is called on a token that represents an XML start or end tag, it will return the code LIBSBML_OPERATION_FAILED.

Parameters
charsstring, characters to append to the text of this token.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
isText()
isElement()
int libsbmlcs.XMLToken.setEnd ( )
inherited

Declares that this token represents an XML element end tag.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
isStart()
isEnd()
int libsbmlcs.XMLToken.setEOF ( )
inherited

Declares that this token is an end-of-file/input marker.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
See also
isEOF()
int libsbmlcs.XMLToken.setNamespaces ( XMLNamespaces  namespaces)
inherited

Sets the XML namespaces on this XML element.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
namespacesthe XMLNamespaces object to be assigned to this XMLToken object.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
Note
This function replaces any existing XMLNamespaces object on this XMLToken object with the new one given by namespaces.
int libsbmlcs.XMLToken.setTriple ( XMLTriple  triple)
inherited

Sets the name, namespace prefix and namespace URI of this token.

This operation only makes sense for XML start elements. This method will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is not an XML start element.

Parameters
triplethe new XMLTriple to use for this XMLToken object. If this XMLToken already had an XMLTriple object stored within it, that object will be replaced.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
string libsbmlcs.XMLToken.toString ( )
inherited

Prints a string representation of the underlying token stream.

This method is intended for debugging purposes.

Returns
a text string representing this XMLToken object.
string libsbmlcs.XMLNode.toXMLString ( )

Returns a string representation of this XMLNode.

Returns
a string derived from this XMLNode.
int libsbmlcs.XMLToken.unsetEnd ( )
inherited

Declares that this token no longer represents an XML start/end element.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
void libsbmlcs.XMLNode.writeToStream ( XMLOutputStream  stream)

Member Data Documentation

bool libsbmlcs.XMLToken.swigCMemOwn
protectedinherited