
Representation of a node in an XML document tree.
Beginning with version 3.0.0, libSBML implements an XML abstraction layer. This layer presents a uniform XML interface to calling programs regardless of which underlying XML parser libSBML has actually been configured to use. The basic data object in the XML abstraction is a node, represented by XMLNode.
An XMLNode can contain any number of children. Each child is another XMLNode, thereby forming a tree. The methods XMLNode::getNumChildren() and XMLNode::getChild() can be used to access the tree structure starting from a given node.
Each XMLNode is subclassed from XMLToken, and thus has the same methods available as XMLToken. These methods include XMLToken::getNamespaces(), XMLToken::getPrefix(), XMLToken::getName(), XMLToken::getURI(), and XMLToken::getAttributes().
LibSBML provides the following utility functions for converting an XML string (e.g., <annotation>...</annotation>) to/from an XMLNode object.
XMLNode::toXMLString() returns a string representation of the XMLNode object.
XMLNode::convertXMLNodeToString() (static function) returns a string representation of the given 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 attribute set in this XMLToken optionally with a prefix and URI defining a namespace. | |
| int | addAttr (const XMLTriple &triple, const std::string &value) |
| Adds an attribute with the given XMLTriple/value pair to the attribute set in this XMLToken. | |
| int | addChild (const XMLNode &node) |
Adds a copy of node as a child of this XMLNode. | |
| int | addNamespace (const std::string &uri, const std::string &prefix="") |
| Appends an XML namespace prefix and URI pair to this XMLToken. | |
| int | append (const std::string &chars) |
| Appends characters to this XML text content. | |
| int | clearAttributes () |
| Clears (deletes) all attributes in this XMLToken. | |
| int | clearNamespaces () |
| Clears (deletes) all XML namespace declarations in the XMLNamespaces of this XMLToken. | |
| XMLNode * | clone () const |
| Creates and returns a deep copy of this XMLNode. | |
| bool | equals (const XMLNode &other) const |
| Compare this XMLNode against another XMLNode returning true if both nodes represent the same XML tree, or false otherwise. | |
| const XMLAttributes & | getAttributes () const |
| Returns the attributes of this element. | |
| int | getAttributesLength () const |
| Return the number of attributes in the attributes set. | |
| int | getAttrIndex (const std::string &name, const std::string &uri="") const |
| Return the index of an attribute with the given local name and namespace URI. | |
| int | getAttrIndex (const XMLTriple &triple) const |
| Return the index of an attribute with the given XMLTriple. | |
| std::string | getAttrName (int index) const |
| Return the local name of an attribute in the attributes set in this XMLToken (by position). | |
| std::string | getAttrPrefix (int index) const |
| Return the prefix of an attribute in the attribute set in this XMLToken (by position). | |
| std::string | getAttrPrefixedName (int index) const |
| Return the prefixed name of an attribute in the attribute set in this XMLToken (by position). | |
| std::string | getAttrURI (int index) const |
| Return the namespace URI of an attribute in the attribute set in this XMLToken (by position). | |
| std::string | getAttrValue (int index) const |
| Return the value of an attribute in the attribute set in this XMLToken (by position). | |
| std::string | getAttrValue (const std::string name, const std::string uri="") const |
| Return a value of an attribute with the given local name and namespace URI. | |
| std::string | getAttrValue (const XMLTriple &triple) const |
| Return a value of an attribute with the given XMLTriple. | |
| const std::string & | getCharacters () const |
| Returns the text of this element. | |
| XMLNode & | getChild (unsigned int n) |
Returns the nth child of this XMLNode. | |
| const XMLNode & | getChild (unsigned int n) const |
Returns the nth child of this XMLNode. | |
| XMLNode & | getChild (const std::string &name) |
| Returns the first child of this XMLNode with the corresponding name. | |
| const XMLNode & | getChild (const std::string &name) const |
| Returns the first child of this XMLNode with the corresponding name. | |
| unsigned int | getColumn () const |
| Returns the column at which this XMLToken occurred in the input document or data stream. | |
| int | getIndex (const std::string &name) const |
| Return the index of the first child of this XMLNode with the given name. | |
| unsigned int | getLine () const |
| Returns the line at which this XMLToken occurred in the input document or data stream. | |
| const std::string & | getName () const |
| Returns the (unqualified) name of this XML element. | |
| int | getNamespaceIndex (const std::string &uri) const |
| Look up the index of an XML namespace declaration by URI. | |
| int | getNamespaceIndexByPrefix (const std::string &prefix) const |
| Look up the index of an XML namespace declaration by prefix. | |
| std::string | getNamespacePrefix (int index) const |
| Look up the prefix of an XML namespace declaration by position. | |
| std::string | getNamespacePrefix (const std::string &uri) const |
| Look up the prefix of an XML namespace declaration by its URI. | |
| const XMLNamespaces & | getNamespaces () const |
| Returns the XML namespace declarations for this XML element. | |
| int | getNamespacesLength () const |
| Returns the number of XML namespaces stored in the XMLNamespaces of this XMLToken. | |
| std::string | getNamespaceURI (int index) const |
| Look up the URI of an XML namespace declaration by its position. | |
| std::string | getNamespaceURI (const std::string &prefix="") const |
| Look up the URI of an XML namespace declaration by its prefix. | |
| unsigned int | getNumChildren () const |
| Returns the number of children for this XMLNode. | |
| const std::string & | getPrefix () const |
| Returns the namespace prefix of this XML element. | |
| const std::string & | getURI () const |
| Returns the namespace URI of this XML element. | |
| bool | hasAttr (int index) const |
Predicate returning true or false depending on whether an attribute with the given index exists in the attribute set in this XMLToken. | |
| bool | hasAttr (const std::string name, const std::string uri="") const |
Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in the attribute set in this XMLToken. | |
| bool | hasAttr (const XMLTriple &triple) const |
Predicate returning true or false depending on whether an attribute with the given XML triple exists in the attribute set in this XMLToken. | |
| bool | hasChild (const std::string &name) const |
| Return a boolean indicating whether this XMLNode has a child with the given name. | |
| bool | hasNamespaceNS (const std::string &uri, const std::string &prefix) const |
Predicate returning true or false depending on whether an XML Namespace with the given uri/prefix pair is contained in the XMLNamespaces ofthis XMLToken. | |
| bool | hasNamespacePrefix (const std::string &prefix) const |
Predicate returning true or false depending on whether an XML Namespace with the given prefix is contained in the XMLNamespaces of this XMLToken. | |
| bool | hasNamespaceURI (const std::string &uri) const |
Predicate returning true or false depending on whether an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken. | |
| XMLNode & | insertChild (unsigned int n, const XMLNode &node) |
Inserts a copy of the given node as the nth child of this XMLNode. | |
| bool | isAttributesEmpty () const |
Predicate returning true or false depending on whether the attribute set in this XMLToken set is empty. | |
| bool | isElement () const |
Predicate returning true or false depending on whether this XMLToken is an XML element. | |
| bool | isEnd () const |
Predicate returning true or false depending on whether this XMLToken is an XML end element. | |
| bool | isEndFor (const XMLToken &element) const |
Predicate returning true or false depending on whether this XMLToken is an XML end element for the given start element. | |
| bool | isEOF () const |
Predicate returning true or false depending on whether this XMLToken is an end of file marker. | |
| bool | isNamespacesEmpty () const |
Predicate returning true or false depending on whether the XMLNamespaces of this XMLToken is empty. | |
| bool | isStart () const |
Predicate returning true or false depending on whether this XMLToken is an XML start element. | |
| bool | isText () const |
Predicate returning true or false depending on whether this XMLToken is an XML text element. | |
| XMLNode & | operator= (const XMLNode &rhs) |
| Assignment operator for XMLNode. | |
| int | removeAttr (int n) |
| Removes an attribute with the given index from the attribute set in this XMLToken. | |
| int | removeAttr (const std::string &name, const std::string &uri="") |
| Removes an attribute with the given local name and namespace URI from the attribute set in this XMLToken. | |
| int | removeAttr (const XMLTriple &triple) |
| Removes an attribute with the given XMLTriple from the attribute set in this XMLToken. | |
| XMLNode * | removeChild (unsigned int n) |
Removes the nth child of this XMLNode and returns the removed node. | |
| int | removeChildren () |
| Removes all children from this node. | |
| int | removeNamespace (int index) |
| Removes an XML Namespace stored in the given position of the XMLNamespaces of this XMLToken. | |
| int | removeNamespace (const std::string &prefix) |
| Removes an XML Namespace with the given prefix. | |
| int | setAttributes (const XMLAttributes &attributes) |
| Sets an XMLAttributes to this XMLToken. | |
| int | setEnd () |
| Declares this XML start element is also an end element. | |
| int | setEOF () |
| Declares this XMLToken is an end-of-file (input) marker. | |
| int | setNamespaces (const XMLNamespaces &namespaces) |
| Sets an XMLnamespaces to this XML element. | |
| int | setTriple (const XMLTriple &triple) |
| Sets the XMLTripe (name, uri and prefix) of this XML element. | |
| std::string | toString () |
| Prints a string representation of the underlying token stream, for debugging purposes. | |
| std::string | toXMLString () const |
| Returns a string representation of this XMLNode. | |
| int | unsetEnd () |
| Declares this XML start/end element is no longer an end element. | |
| XMLNode () | |
| Creates a new empty XMLNode with no children. | |
| XMLNode (const XMLToken &token) | |
| Creates a new XMLNode by copying token. | |
| 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. | |
| 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. | |
| XMLNode (const XMLTriple &triple, const unsigned int line=0, const unsigned int column=0) | |
| Creates an end element XMLNode. | |
| XMLNode (const std::string &chars, const unsigned int line=0, const unsigned int column=0) | |
| Creates a text XMLNode. | |
| XMLNode (const XMLNode &orig) | |
| Copy constructor; creates a copy of this XMLNode. | |
| virtual | ~XMLNode () |
| Destroys this XMLNode. | |
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. | |
| static std::string | convertXMLNodeToString (const XMLNode *node) |
| Returns a string representation of a given XMLNode. | |
| 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 |
||
| ) |
| XMLNode::~XMLNode | ( | ) | [virtual] |
Destroys this XMLNode.
| XMLNode::XMLNode | ( | const XMLNode & | orig | ) |
| int XMLToken::addAttr | ( | const std::string & | name, |
| const std::string & | value, | ||
| const std::string & | namespaceURI = "", |
||
| const std::string & | prefix = "" |
||
| ) | [inherited] |
Adds an attribute to the attribute set in this XMLToken optionally with a prefix and URI defining a namespace.
Nothing will be done if this XMLToken is not a start element.
| name | a string, the local name of the attribute. |
| value | a string, the value of the attribute. |
| namespaceURI | a string, the namespace URI of the attribute. |
| prefix | a string, the prefix of the namespace |
| int XMLToken::addAttr | ( | const XMLTriple & | triple, |
| const std::string & | value | ||
| ) | [inherited] |
Adds an attribute with the given XMLTriple/value pair to the attribute set in this XMLToken.
Nothing will be done if this XMLToken is not a start element.
| triple | an XMLTriple, the XML triple of the attribute. |
| value | a string, the value of 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. |
| int XMLToken::addNamespace | ( | const std::string & | uri, |
| const std::string & | prefix = "" |
||
| ) | [inherited] |
Appends an XML namespace prefix and URI pair to this XMLToken.
If there is an XML namespace with the given prefix in this XMLToken, then the existing XML namespace will be overwritten by the new one.
Nothing will be done if this XMLToken is not a start element.
| uri | a string, the uri for the namespace |
| prefix | a string, the prefix for the namespace |
| int XMLToken::append | ( | const std::string & | chars | ) | [inherited] |
Appends characters to this XML text content.
| chars | string, characters to append |
| int XMLToken::clearAttributes | ( | ) | [inherited] |
| int XMLToken::clearNamespaces | ( | ) | [inherited] |
Clears (deletes) all XML namespace declarations in the XMLNamespaces of this XMLToken.
Nothing will be done if this XMLToken is not a start element.
| XMLNode * XMLNode::clone | ( | ) | const |
| XMLNode * XMLNode::convertStringToXMLNode | ( | const std::string & | xmlstr, |
| const XMLNamespaces * | xmlns = NULL |
||
| ) | [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. | std::string XMLNode::convertXMLNodeToString | ( | const XMLNode * | node | ) | [static] |
| bool XMLNode::equals | ( | const XMLNode & | other | ) | const |
| const XMLAttributes & XMLToken::getAttributes | ( | ) | const [inherited] |
Returns the attributes of this element.
| int XMLToken::getAttributesLength | ( | ) | const [inherited] |
Return the number of attributes in the attributes set.
| int XMLToken::getAttrIndex | ( | const std::string & | name, |
| const std::string & | uri = "" |
||
| ) | const [inherited] |
Return the index of an attribute with the given local name and namespace URI.
| name | a string, the local name of the attribute. |
| uri | a string, the namespace URI of the attribute. |
-1 if not present. | int XMLToken::getAttrIndex | ( | const XMLTriple & | triple | ) | const [inherited] |
| std::string XMLToken::getAttrName | ( | int | index | ) | const [inherited] |
Return the local name of an attribute in the attributes set in this XMLToken (by position).
| index | an integer, the position of the attribute whose local name is required. |
| std::string XMLToken::getAttrPrefix | ( | int | index | ) | const [inherited] |
Return the prefix of an attribute in the attribute set in this XMLToken (by position).
| index | an integer, the position of the attribute whose prefix is required. |
| std::string XMLToken::getAttrPrefixedName | ( | int | index | ) | const [inherited] |
Return the prefixed name of an attribute in the attribute set in this XMLToken (by position).
| index | an integer, the position of the attribute whose prefixed name is required. |
| std::string XMLToken::getAttrURI | ( | int | index | ) | const [inherited] |
Return the namespace URI of an attribute in the attribute set in this XMLToken (by position).
| index | an integer, the position of the attribute whose namespace URI is required. |
| std::string XMLToken::getAttrValue | ( | int | index | ) | const [inherited] |
Return the value of an attribute in the attribute set in this XMLToken (by position).
| index | an integer, the position of the attribute whose value is required. |
| std::string XMLToken::getAttrValue | ( | const std::string | name, |
| const std::string | uri = "" |
||
| ) | const [inherited] |
Return a value of an attribute with the given local name and namespace URI.
| name | a string, the local name of the attribute whose value is required. |
| uri | a string, the namespace URI of the attribute. |
| std::string XMLToken::getAttrValue | ( | const XMLTriple & | triple | ) | const [inherited] |
Return a value of an attribute with the given XMLTriple.
| triple | an XMLTriple, the XML triple of the attribute whose value is required. |
| const string & XMLToken::getCharacters | ( | ) | const [inherited] |
Returns the text of this element.
| XMLNode & XMLNode::getChild | ( | unsigned int | n | ) |
| const XMLNode & XMLNode::getChild | ( | unsigned int | n | ) | const |
| XMLNode & XMLNode::getChild | ( | const std::string & | name | ) |
| const XMLNode & XMLNode::getChild | ( | const std::string & | name | ) | const |
| unsigned int XMLToken::getColumn | ( | ) | const [inherited] |
| int XMLNode::getIndex | ( | const std::string & | name | ) | const |
| unsigned int XMLToken::getLine | ( | ) | const [inherited] |
| const string & XMLToken::getName | ( | ) | const [inherited] |
Returns the (unqualified) name of this XML element.
| int XMLToken::getNamespaceIndex | ( | const std::string & | uri | ) | const [inherited] |
Look up the index of an XML namespace declaration by URI.
| uri | a string, uri of the required namespace. |
-1 if not present. | int XMLToken::getNamespaceIndexByPrefix | ( | const std::string & | prefix | ) | const [inherited] |
Look up the index of an XML namespace declaration by prefix.
| prefix | a string, prefix of the required namespace. |
-1 if not present. | std::string XMLToken::getNamespacePrefix | ( | int | index | ) | const [inherited] |
Look up the prefix of an XML namespace declaration by position.
Callers should use getNamespacesLength() to find out how many namespaces are stored in the XMLNamespaces.
| index | an integer, position of the required prefix. |
| std::string XMLToken::getNamespacePrefix | ( | const std::string & | uri | ) | const [inherited] |
Look up the prefix of an XML namespace declaration by its URI.
| uri | a string, the URI of the prefix being sought |
uri does not exist, an empty string will be returned. | const XMLNamespaces & XMLToken::getNamespaces | ( | ) | const [inherited] |
Returns the XML namespace declarations for this XML element.
| int XMLToken::getNamespacesLength | ( | ) | const [inherited] |
Returns the number of XML namespaces stored in the XMLNamespaces of this XMLToken.
| std::string XMLToken::getNamespaceURI | ( | int | index | ) | const [inherited] |
Look up the URI of an XML namespace declaration by its position.
| index | an integer, position of the required URI. |
index is out of range, an empty string will be returned.| std::string XMLToken::getNamespaceURI | ( | const std::string & | prefix = "" | ) | const [inherited] |
Look up the URI of an XML namespace declaration by its prefix.
| prefix | a string, the prefix of the required URI |
prefix does not exist, an empty string will be returned. | unsigned int XMLNode::getNumChildren | ( | ) | const |
| const string & XMLToken::getPrefix | ( | ) | const [inherited] |
Returns the namespace prefix of this XML element.
| const string & XMLToken::getURI | ( | ) | const [inherited] |
Returns the namespace URI of this XML element.
| bool XMLToken::hasAttr | ( | int | index | ) | const [inherited] |
Predicate returning true or false depending on whether an attribute with the given index exists in the attribute set in this XMLToken.
| index | an integer, the position of the attribute. |
true if an attribute with the given index exists in the attribute set in this XMLToken, false otherwise. | bool XMLToken::hasAttr | ( | const std::string | name, |
| const std::string | uri = "" |
||
| ) | const [inherited] |
Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in the attribute set in this XMLToken.
| name | a string, the local name of the attribute. |
| uri | a string, the namespace URI of the attribute. |
true if an attribute with the given local name and namespace URI exists in the attribute set in this XMLToken, false otherwise. | bool XMLToken::hasAttr | ( | const XMLTriple & | triple | ) | const [inherited] |
Predicate returning true or false depending on whether an attribute with the given XML triple exists in the attribute set in this XMLToken.
| triple | an XMLTriple, the XML triple of the attribute |
true if an attribute with the given XML triple exists in the attribute set in this XMLToken, false otherwise. | bool XMLNode::hasChild | ( | const std::string & | name | ) | const |
| bool XMLToken::hasNamespaceNS | ( | const std::string & | uri, |
| const std::string & | prefix | ||
| ) | const [inherited] |
Predicate returning true or false depending on whether an XML Namespace with the given uri/prefix pair is contained in the XMLNamespaces ofthis XMLToken.
| 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 of this XMLToken, false otherwise. | bool XMLToken::hasNamespacePrefix | ( | const std::string & | prefix | ) | const [inherited] |
Predicate returning true or false depending on whether an XML Namespace with the given prefix is contained in the XMLNamespaces of this XMLToken.
| prefix | a string, the prefix for the namespace |
true if an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken, false otherwise. | bool XMLToken::hasNamespaceURI | ( | const std::string & | uri | ) | const [inherited] |
Predicate returning true or false depending on whether an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken.
| uri | a string, the uri for the namespace |
true if an XML Namespace with the given URI is contained in the XMLNamespaces of this XMLToken, false otherwise. | XMLNode & XMLNode::insertChild | ( | unsigned int | n, |
| const 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.
| n | an integer, the index at which the given node is inserted |
| node | an XMLNode to be inserted as nth child. |
node | bool XMLToken::isAttributesEmpty | ( | ) | const [inherited] |
| bool XMLToken::isElement | ( | ) | const [inherited] |
| bool XMLToken::isEnd | ( | ) | const [inherited] |
| bool XMLToken::isEndFor | ( | const XMLToken & | element | ) | const [inherited] |
| bool XMLToken::isEOF | ( | ) | const [inherited] |
| bool XMLToken::isNamespacesEmpty | ( | ) | const [inherited] |
Predicate returning true or false depending on whether the XMLNamespaces of this XMLToken is empty.
true if the XMLNamespaces of this XMLToken is empty, false otherwise. | bool XMLToken::isStart | ( | ) | const [inherited] |
| bool XMLToken::isText | ( | ) | const [inherited] |
| int XMLToken::removeAttr | ( | int | n | ) | [inherited] |
Removes an attribute with the given index from the attribute set in this XMLToken.
Nothing will be done if this XMLToken is not a start element.
| n | an integer the index of the resource to be deleted |
| int XMLToken::removeAttr | ( | const std::string & | name, |
| const std::string & | uri = "" |
||
| ) | [inherited] |
Removes an attribute with the given local name and namespace URI from the attribute set in this XMLToken.
Nothing will be done if this XMLToken is not a start element.
| name | a string, the local name of the attribute. |
| uri | a string, the namespace URI of the attribute. |
| int XMLToken::removeAttr | ( | const XMLTriple & | triple | ) | [inherited] |
Removes an attribute with the given XMLTriple from the attribute set in this XMLToken.
Nothing will be done if this XMLToken is not a start element.
| triple | an XMLTriple, the XML triple of the attribute. |
| XMLNode * XMLNode::removeChild | ( | unsigned int | 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).
| 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.
| int XMLToken::removeNamespace | ( | int | index | ) | [inherited] |
Removes an XML Namespace stored in the given position of the XMLNamespaces of this XMLToken.
Nothing will be done if this XMLToken is not a start element.
| index | an integer, position of the removed namespace. |
| int XMLToken::removeNamespace | ( | const std::string & | prefix | ) | [inherited] |
Removes an XML Namespace with the given prefix.
Nothing will be done if this XMLToken is not a start element.
| prefix | a string, prefix of the required namespace. |
| int XMLToken::setAttributes | ( | const XMLAttributes & | attributes | ) | [inherited] |
Sets an XMLAttributes to this XMLToken.
Nothing will be done if this XMLToken is not a start element.
| attributes | XMLAttributes to be set to this XMLToken. |
| int XMLToken::setEnd | ( | ) | [inherited] |
Declares this XML start element is also an end element.
| int XMLToken::setEOF | ( | ) | [inherited] |
Declares this XMLToken is an end-of-file (input) marker.
| int XMLToken::setNamespaces | ( | const XMLNamespaces & | namespaces | ) | [inherited] |
Sets an XMLnamespaces to this XML element.
Nothing will be done if this XMLToken is not a start element.
| namespaces | XMLNamespaces to be set to this XMLToken. |
| int XMLToken::setTriple | ( | const XMLTriple & | triple | ) | [inherited] |
Sets the XMLTripe (name, uri and prefix) of this XML element.
Nothing will be done if this XML element is a text node.
| triple | XMLTriple to be added to this XML element. |
| string XMLToken::toString | ( | ) | [inherited] |
Prints a string representation of the underlying token stream, for debugging purposes.
| std::string XMLNode::toXMLString | ( | ) | const |
| int XMLToken::unsetEnd | ( | ) | [inherited] |
Declares this XML start/end element is no longer an end element.