libSBML C++ API
5.20.4
|
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().
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 (const std::string &name, const std::string &value, const std::string namespaceURI="", const std::string prefix="") |
Adds an attribute to the XML element represented by this token. More... | |
int | addAttr (const XMLTriple &triple, const std::string &value) |
Adds an attribute to the XML element represented by this token. More... | |
int | addChild (const XMLNode &node) |
Adds a copy of node as a child of this XMLNode. More... | |
int | addNamespace (const std::string &uri, const std::string prefix="") |
Appends an XML namespace declaration to this token. More... | |
int | append (const std::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... | |
XMLNode * | clone () const |
Creates and returns a deep copy of this XMLNode object. More... | |
bool | equals (const XMLNode &other, bool ignoreURI=false, bool ignoreAttributeValues=false) const |
Compare this XMLNode against another XMLNode returning true if both nodes represent the same XML tree, or false otherwise. More... | |
const XMLAttributes & | getAttributes () const |
Returns the attributes of the XML element represented by this token. More... | |
int | getAttributesLength () const |
Returns the number of attributes on this XMLToken object. More... | |
int | getAttrIndex (const std::string &name, const std::string uri="") const |
Returns the index of the attribute with the given name and namespace URI. More... | |
int | getAttrIndex (const XMLTriple &triple) const |
Returns the index of the attribute defined by the given XMLTriple object. More... | |
std::string | getAttrName (int index) const |
Returns the name of the nth attribute in this token's list of attributes. More... | |
std::string | getAttrPrefix (int index) const |
Returns the prefix of the nth attribute in this token's list of attributes. More... | |
std::string | getAttrPrefixedName (int index) const |
Returns the prefixed name of the nth attribute in this token's list of attributes. More... | |
std::string | getAttrURI (int index) const |
Returns the XML namespace URI of the nth attribute in this token's list of attributes. More... | |
std::string | getAttrValue (const std::string &name, const std::string uri="") const |
Returns the value of the attribute with a given name and XML namespace URI. More... | |
std::string | getAttrValue (const XMLTriple &triple) const |
Returns the value of the attribute specified by a given XMLTriple object. More... | |
std::string | getAttrValue (int index) const |
Returns the value of the nth attribute in this token's list of attributes. More... | |
const std::string & | getCharacters () const |
Returns the character text of token. More... | |
XMLNode & | getChild (const std::string &name) |
Returns the first child of this XMLNode with the corresponding name. More... | |
const XMLNode & | getChild (const std::string &name) const |
Returns the first child of this XMLNode with the corresponding name. More... | |
XMLNode & | getChild (unsigned int n) |
Returns the n th child of this XMLNode. More... | |
const XMLNode & | getChild (unsigned int n) const |
Returns the n th child of this XMLNode. More... | |
unsigned int | getColumn () const |
Returns the column number at which this token occurs in the input. More... | |
int | getIndex (const std::string &name) const |
Return the index of the first child of this XMLNode with the given name. More... | |
unsigned int | getLine () const |
Returns the line number at which this token occurs in the input. More... | |
const std::string & | getName () const |
Returns the (unqualified) name of token. More... | |
int | getNamespaceIndex (const std::string &uri) const |
Returns the index of an XML namespace declaration based on its URI. More... | |
int | getNamespaceIndexByPrefix (const std::string &prefix) const |
Returns the index of an XML namespace declaration based on its prefix. More... | |
std::string | getNamespacePrefix (const std::string &uri) const |
Returns the prefix associated with a given XML namespace URI on this token. More... | |
std::string | getNamespacePrefix (int index) const |
Returns the prefix of the nth XML namespace declaration. More... | |
const XMLNamespaces & | getNamespaces () const |
Returns the XML namespaces declared for this token. More... | |
int | getNamespacesLength () const |
Returns the number of XML namespaces declared on this token. More... | |
std::string | getNamespaceURI (const std::string prefix="") const |
Returns the URI of an XML namespace with a given prefix. More... | |
std::string | getNamespaceURI (int index) const |
Returns the URI of the nth XML namespace declared on this token. More... | |
unsigned int | getNumChildren () const |
Returns the number of children for this XMLNode. More... | |
const std::string & | getPrefix () const |
Returns the XML namespace prefix of token. More... | |
const std::string & | getURI () const |
Returns the XML namespace URI of token. More... | |
bool | hasAttr (const std::string &name, const std::string uri="") const |
Returns true if an attribute with a given name and namespace URI exists. More... | |
bool | hasAttr (const XMLTriple &triple) const |
Returns true if an attribute defined by a given XMLTriple object exists. More... | |
bool | hasAttr (int index) const |
Returns true if an attribute with the given index exists. More... | |
bool | hasChild (const std::string &name) const |
Return a boolean indicating whether this XMLNode has a child with the given name. More... | |
bool | hasNamespaceNS (const std::string &uri, const std::string &prefix) const |
Returns true if this token has an XML namespace with a given prefix and URI combination. More... | |
bool | hasNamespacePrefix (const std::string &prefix) const |
Returns true if this token has an XML namespace with a given prefix. More... | |
bool | hasNamespaceURI (const std::string &uri) const |
Returns true if this token has an XML namespace with a given URI. More... | |
XMLNode & | insertChild (unsigned int n, const XMLNode &node) |
Inserts a copy of the given node as the n th child of this XMLNode. More... | |
bool | isAttributesEmpty () const |
Returns true if this token has no attributes. More... | |
bool | isElement () const |
Returns true if this token represents an XML element. More... | |
bool | isEnd () const |
Returns true if this token represents an XML end element. More... | |
bool | isEndFor (const XMLToken &element) const |
Returns true if this token represents an XML end element for a particular start element. More... | |
bool | isEOF () const |
Returns true if this token is an end of file marker. More... | |
bool | isNamespacesEmpty () const |
Returns true if there are no namespaces declared on this token. More... | |
bool | isStart () const |
Returns true if this token represents an XML start element. More... | |
bool | isText () const |
Returns true if this token represents an XML text element. More... | |
XMLNode & | operator= (const XMLNode &rhs) |
Assignment operator for XMLNode. More... | |
int | removeAttr (const std::string &name, const std::string uri="") |
Removes an attribute from the XML element represented by this token. More... | |
int | removeAttr (const XMLTriple &triple) |
Removes an attribute from the XML element represented by this token. More... | |
int | removeAttr (int n) |
Removes the nth attribute from the XML element represented by this token. More... | |
XMLNode * | removeChild (unsigned int n) |
Removes the n th child of this XMLNode and returns the removed node. More... | |
int | removeChildren () |
Removes all children from this node. More... | |
int | removeNamespace (const std::string &prefix) |
Removes an XML namespace declaration having a given prefix. More... | |
int | removeNamespace (int index) |
Removes the nth XML namespace declaration. More... | |
int | setAttributes (const XMLAttributes &attributes) |
Sets the attributes on the XML element represented by this token. More... | |
int | setCharacters (const std::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 (const XMLNamespaces &namespaces) |
Sets the XML namespaces on this XML element. More... | |
int | setTriple (const XMLTriple &triple) |
Sets the name, namespace prefix and namespace URI of this token. More... | |
std::string | toString () |
Prints a string representation of the underlying token stream. More... | |
std::string | toXMLString () const |
Returns a string representation of this XMLNode. More... | |
int | unsetEnd () |
Declares that this token no longer represents an XML start/end element. More... | |
XMLNode () | |
Creates a new empty XMLNode with no children. More... | |
XMLNode (const std::string &chars, const unsigned int line=0, const unsigned int column=0) | |
Creates a text XMLNode. More... | |
XMLNode (const XMLNode &orig) | |
Copy constructor; creates a copy of this XMLNode. More... | |
XMLNode (const XMLToken &token) | |
Creates a new XMLNode by copying an XMLToken object. More... | |
XMLNode (const XMLTriple &triple, const unsigned int line=0, const unsigned int column=0) | |
Creates an end element XMLNode. More... | |
XMLNode (const XMLTriple &triple, const XMLAttributes &attributes, const unsigned int line=0, const unsigned int column=0) | |
Creates a start element XMLNode with the given set of attributes. More... | |
XMLNode (const XMLTriple &triple, const XMLAttributes &attributes, const XMLNamespaces &namespaces, const unsigned int line=0, const unsigned int column=0) | |
Creates a new start element XMLNode with the given set of attributes and namespace declarations. More... | |
virtual | ~XMLNode () |
Destroys this XMLNode. More... | |
Static Public Member Functions | |
static XMLNode * | convertStringToXMLNode (const std::string &xmlstr, const XMLNamespaces *xmlns=NULL) |
Returns an XMLNode which is derived from a string containing XML content. More... | |
static std::string | convertXMLNodeToString (const XMLNode *node) |
Returns a string representation of a given XMLNode. More... | |
static XMLNode * | readXMLNodeFromFile (const std::string &filename) |
Returns an XMLNode which is readfrom a file containing XML content. More... | |
XMLNode::XMLNode | ( | ) |
Creates a new empty XMLNode with no children.
XMLNode::XMLNode | ( | const XMLToken & | token | ) |
XMLNode::XMLNode | ( | const XMLTriple & | triple, |
const XMLAttributes & | attributes, | ||
const XMLNamespaces & | namespaces, | ||
const unsigned int | line = 0 , |
||
const unsigned int | column = 0 |
||
) |
Creates a new start element XMLNode with the given set of attributes and namespace declarations.
triple | XMLTriple. |
attributes | XMLAttributes, the attributes to set. |
namespaces | XMLNamespaces, the namespaces to set. |
line | an unsigned int, the line number (default = 0). |
column | an unsigned int, the column number (default = 0). |
XMLNode::XMLNode | ( | const XMLTriple & | triple, |
const XMLAttributes & | attributes, | ||
const unsigned int | line = 0 , |
||
const unsigned int | column = 0 |
||
) |
Creates a start element XMLNode with the given set of attributes.
triple | XMLTriple. |
attributes | XMLAttributes, the attributes to set. |
line | an unsigned int, the line number (default = 0). |
column | an unsigned int, the column number (default = 0). |
XMLNode::XMLNode | ( | const XMLTriple & | triple, |
const unsigned int | line = 0 , |
||
const unsigned int | column = 0 |
||
) |
XMLNode::XMLNode | ( | const std::string & | chars, |
const unsigned int | line = 0 , |
||
const unsigned int | column = 0 |
||
) |
|
virtual |
Destroys this XMLNode.
XMLNode::XMLNode | ( | const XMLNode & | orig | ) |
|
inherited |
Adds an attribute to the XML element represented by this token.
name | a string, the so-called "local part" of the attribute name; that is, the attribute name without any namespace qualifier or prefix. |
value | a string, the value assigned to the attribute. |
namespaceURI | a string, the XML namespace URI of the attribute. |
prefix | a string, the prefix for the XML namespace. |
Recall that in XML, the complete form of an attribute on an XML element is the following:
prefix:name="value"
The name
part is the name of the attribute, the "value"
part is the value assigned to the attribute (and it is always a quoted string), and the prefix
part is an optional XML namespace prefix. Internally in libSBML, this data is stored in an XMLAttributes object associated with this XMLToken.
|
inherited |
Adds an attribute to the XML element represented by this token.
triple | an XMLTriple object defining the attribute, its value, and optionally its XML namespace (if any is provided). |
value | a string, the value assigned to the attribute. |
int XMLNode::addChild | ( | const 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.
node | the XMLNode to be added as child. |
|
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
.
uri | a string, the XML namespace URI for the namespace. |
prefix | a string, the namespace prefix to use. |
|
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.
chars | string, characters to append to the text of this token. |
|
inherited |
Removes all attributes of this XMLToken object.
|
inherited |
Removes all XML namespace declarations from this token.
XMLNode * XMLNode::clone | ( | ) | const |
|
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.
xmlstr | string to be converted to a XML node. |
xmlns | XMLNamespaces the namespaces to set (default value is NULL ). |
<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.xmlstr
. If the conversion failed, this method returns NULL
.
|
static |
bool XMLNode::equals | ( | const XMLNode & | other, |
bool | ignoreURI = false , |
||
bool | ignoreAttributeValues = false |
||
) | const |
Compare this XMLNode against another XMLNode returning true if both nodes represent the same XML tree, or false otherwise.
other | another XMLNode to compare against. |
ignoreURI | whether to ignore the namespace URI when doing the comparison. |
ignoreAttributeValues | whetehr to ignore attribute values when doing the comparison. |
other | another XMLNode to compare against |
|
inherited |
Returns the attributes of the XML element represented by this token.
|
inherited |
|
inherited |
Returns the index of the attribute with the given name and namespace URI.
name | a string, the name of the attribute. |
uri | a string, the namespace URI of the attribute. |
-1
if it is not present on this token.
|
inherited |
|
inherited |
Returns the name of the nth attribute in this token's list of attributes.
index | an integer, the position of the attribute whose name is being sought. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
|
inherited |
Returns the prefix of the nth attribute in this token's list of attributes.
index | an integer, the position of the attribute whose prefix is being sought. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
|
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
.
index | an integer, the position of the attribute whose prefixed name is being sought. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
|
inherited |
Returns the XML namespace URI of the nth attribute in this token's list of attributes.
index | an integer, the position of the attribute whose namespace URI is being sought. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
|
inherited |
Returns the value of the attribute with a given name and XML namespace URI.
name | a string, the name of the attribute whose value is being sought. |
uri | a string, the XML namespace URI of the attribute. |
name
and uri
does not exist on this token object, this method will return an empty string. XMLToken::hasAttr() can be used to test explicitly for the presence of an attribute with a given name and namespace.
|
inherited |
Returns the value of the attribute specified by a given XMLTriple object.
triple | an XMLTriple describing the attribute whose value is being sought. |
triple
does not exist on this token object, this method will return an empty string. XMLToken::hasAttr() can be used to test explicitly for the existence of an attribute with the properties of a given triple.
|
inherited |
Returns the value of the nth attribute in this token's list of attributes.
index | an integer, the position of the attribute whose value is required. |
n
in the list of attributes possessed by this XMLToken object.index
is out of range, this method will return an empty string. XMLToken::hasAttr() can be used to test for an attribute's existence explicitly, and XMLToken::getAttributesLength() can be used to find out the number of attributes possessed by this token.
|
inherited |
Returns the character text of token.
XMLNode & XMLNode::getChild | ( | const std::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.
name | the name of the node to return. |
If no child with corrsponding name can be found, this method returns an empty node.
name | the name of the node to return |
const XMLNode & XMLNode::getChild | ( | const std::string & | name | ) | const |
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.
name | the name of the node to return. |
If no child with corrsponding name can be found, this method returns an empty node.
name | the name of the node to return |
XMLNode & XMLNode::getChild | ( | unsigned int | n | ) |
const XMLNode & XMLNode::getChild | ( | unsigned int | n | ) | const |
|
inherited |
Returns the column number at which this token occurs in the input.
int XMLNode::getIndex | ( | const std::string & | name | ) | const |
|
inherited |
Returns the line number at which this token occurs in the input.
|
inherited |
Returns the (unqualified) name of token.
|
inherited |
Returns the index of an XML namespace declaration based on its URI.
uri | a string, the XML namespace URI of the sought-after namespace. |
-1
if no such namespace URI is present on this XMLToken object.
|
inherited |
Returns the index of an XML namespace declaration based on its prefix.
prefix | a string, the prefix of the sought-after XML namespace. |
-1
if no such namespace URI is present on this XMLToken object.
|
inherited |
Returns the prefix associated with a given XML namespace URI on this token.
uri | a string, the URI of the namespace whose prefix is being sought. |
uri
declared on this XMLToken object, this method will return an empty string.
|
inherited |
Returns the prefix of the nth XML namespace declaration.
index | an integer, position of the required prefix. |
index
is out of range, this method will return an empty string. XMLToken::getNamespacesLength() can be used to find out how many namespaces are defined on this XMLToken object.
|
inherited |
Returns the XML namespaces declared for this token.
|
inherited |
Returns the number of XML namespaces declared on this token.
|
inherited |
Returns the URI of an XML namespace with a given prefix.
prefix | a string, the prefix of the sought-after XML namespace URI. |
prefix
stored in the XMLNamespaces object of this XMLToken object, this method will return an empty string.
|
inherited |
Returns the URI of the nth XML namespace declared on this token.
index | an integer, the position of the sought-after XML namespace URI. |
index
is out of range, this method will return an empty string.unsigned int XMLNode::getNumChildren | ( | ) | const |
|
inherited |
Returns the XML namespace prefix of token.
|
inherited |
Returns the XML namespace URI of token.
|
inherited |
Returns true
if an attribute with a given name and namespace URI exists.
name | a string, the name of the attribute being sought. |
uri | a string, the XML namespace URI of the attribute being sought. |
true
if an attribute with the given local name and namespace URI exists in the list of attributes on this token object, false
otherwise.
|
inherited |
|
inherited |
Returns true
if an attribute with the given index exists.
index | an integer, the position of the attribute. |
true
if this token object possesses an attribute with the given index, false
otherwise. bool XMLNode::hasChild | ( | const std::string & | name | ) | const |
|
inherited |
Returns true
if this token has an XML namespace with a given prefix and URI combination.
uri | a string, the URI for the namespace. |
prefix | a string, the prefix for the namespace. |
true
if an XML namespace with the given URI/prefix pair is contained in the XMLNamespaces object of this XMLToken object, false
otherwise.
|
inherited |
Returns true
if this token has an XML namespace with a given prefix.
prefix | a string, the prefix for the XML namespace. |
true
if an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken, false
otherwise.
|
inherited |
Returns true
if this token has an XML namespace with a given URI.
uri | a string, the URI of the XML namespace. |
true
if an XML namespace with the given URI is contained in the XMLNamespaces object of this XMLToken object, false
otherwise. Inserts a copy of the given node as the n
th 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.
n | an integer, the index at which the given node is inserted. |
node | an XMLNode to be inserted as n th child. |
node
.
|
inherited |
Returns true
if this token has no attributes.
true
if the list of attributes on XMLToken object is empty, false
otherwise.
|
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.
true
if this XMLToken object represents an XML element, false
otherwise.
|
inherited |
Returns true
if this token represents an XML end element.
true
if this XMLToken object represents an XML end element, false
otherwise.
|
inherited |
Returns true
if this token represents an XML end element for a particular start element.
element | XMLToken, the element with which the current object should be compared to determined whether the current object is a start element for the given one. |
true
if this XMLToken object represents an XML end tag for the start tag given by element
, false
otherwise.
|
inherited |
|
inherited |
Returns true
if there are no namespaces declared on this token.
true
if the XMLNamespaces object stored in this XMLToken token is empty, false
otherwise.
|
inherited |
Returns true
if this token represents an XML start element.
true
if this XMLToken is an XML start element, false
otherwise.
|
inherited |
Returns true
if this token represents an XML text element.
true
if this XMLToken is an XML text element, false
otherwise.
|
static |
Returns an XMLNode which is readfrom a file containing XML content.
The XML namespace must be defined using argument xmlns
if the corresponding XML namespace attribute is not part of the file of the first argument.
filename | string name of file to be read to a XML node. |
xmlns | XMLNamespaces the namespaces to set (default value is NULL ). |
<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.filename
. If the conversion failed, this method returns NULL
.
|
inherited |
Removes an attribute from the XML element represented by this token.
name | a string, the name of the attribute to be removed. |
uri | a string, the XML namespace URI of the attribute to be removed. |
name
(and uri
if specified).
|
inherited |
Removes an attribute from the XML element represented by this token.
triple | an XMLTriple describing the attribute to be removed. |
triple
.
|
inherited |
Removes the nth attribute from the XML element represented by this token.
n | an integer the index of the resource to be deleted. |
n
.XMLNode * XMLNode::removeChild | ( | unsigned int | n | ) |
Removes the n
th 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
).
n | an integer, the index of the node to be removed. |
NULL
if n
is greater than the number of children in this node.int XMLNode::removeChildren | ( | ) |
Removes all children from this node.
|
inherited |
Removes an XML namespace declaration having a given prefix.
prefix | a string, the prefix of the namespace to be removed. |
prefix
on this element.
|
inherited |
Removes the nth XML namespace declaration.
index | an integer, the position of the namespace to be removed. The position in this context refers to the position of the namespace in the XMLNamespaces object stored in this XMLToken object. Callers can use one of the getNamespace___() methods to find the index number of a given namespace. |
|
inherited |
Sets the attributes on the XML element represented by this token.
attributes | an XMLAttributes object to be assigned to this XMLToken object, thereby setting the XML attributes associated with this token. |
attributes
.
|
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.
chars | string, characters to append to the text of this token. |
|
inherited |
Declares that this token represents an XML element end tag.
|
inherited |
Declares that this token is an end-of-file/input marker.
|
inherited |
Sets the XML namespaces on this XML element.
namespaces | the XMLNamespaces object to be assigned to this XMLToken object. |
namespaces
.
|
inherited |
Sets the name, namespace prefix and namespace URI of this token.
triple | the new XMLTriple to use for this XMLToken object. If this XMLToken already had an XMLTriple object stored within it, that object will be replaced. |
|
inherited |
Prints a string representation of the underlying token stream.
This method is intended for debugging purposes.
std::string XMLNode::toXMLString | ( | ) | const |
|
inherited |
Declares that this token no longer represents an XML start/end element.