libSBML C# API
5.18.0
|
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.
The libSBML XML parser interface can read an XML file or data stream and convert the contents into tokens. The tokens represent items in the XML stream, either XML elements (start or end tags) or text that appears as content inside an element. The XMLToken class is libSBML's low-level representation of these entities.
Each XMLToken has the following information associated with it:
<mytag>
, the name is 'mytag'
), but this name may be qualified with a namespace (e.g., it may appear as <someNamespace:mytag>
in the input). An XMLToken stores the name of a token, along with any namespace qualification present, through the use of an XMLTriple object. This object stores the bare name of the element, its XML namespace prefix (if any), and the XML namespace with which that prefix is associated. The XMLToken class serves as base class for XMLNode. XML lends itself to a tree-structured representation, and in libSBML, the nodes in an XML document tree are XMLNode objects. Most higher-level libSBML classes and methods that offer XML-level functionality (such as the methods on SBase for interacting with annotations) work with XMLNode objects rather than XMLToken objects directly.
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 | 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... | |
XMLToken | clone () |
Creates and returns a deep copy of this XMLToken object. More... | |
virtual void | Dispose () |
override bool | Equals (Object sb) |
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... | |
long | getColumn () |
Returns the column number at which this token occurs in the input. More... | |
override int | GetHashCode () |
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... | |
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 | 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... | |
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... | |
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... | |
int | unsetEnd () |
Declares that this token no longer represents an XML start/end element. More... | |
XMLToken () | |
Creates a new empty XMLToken object. More... | |
XMLToken (XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line, long column) | |
Creates an XML start element with attributes and namespace declarations. More... | |
XMLToken (XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, long line) | |
Creates an XML start element with attributes and namespace declarations. More... | |
XMLToken (XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces) | |
Creates an XML start element with attributes and namespace declarations. More... | |
XMLToken (XMLTriple triple, XMLAttributes attributes, long line, long column) | |
Creates an XML start element with attributes. More... | |
XMLToken (XMLTriple triple, XMLAttributes attributes, long line) | |
Creates an XML start element with attributes. More... | |
XMLToken (XMLTriple triple, XMLAttributes attributes) | |
Creates an XML start element with attributes. More... | |
XMLToken (XMLTriple triple, long line, long column) | |
Creates an XML end element. More... | |
XMLToken (XMLTriple triple, long line) | |
Creates an XML end element. More... | |
XMLToken (XMLTriple triple) | |
Creates an XML end element. More... | |
XMLToken (string chars, long line, long column) | |
Creates a text object. More... | |
XMLToken (string chars, long line) | |
Creates a text object. More... | |
XMLToken (string chars) | |
Creates a text object. More... | |
XMLToken (XMLToken orig) | |
Copy constructor; creates a copy of this XMLToken object. More... | |
Static Public Member Functions | |
static bool | operator!= (XMLToken lhs, XMLToken rhs) |
static bool | operator== (XMLToken lhs, XMLToken rhs) |
Protected Attributes | |
bool | swigCMemOwn |
libsbmlcs.XMLToken.XMLToken | ( | ) |
Creates a new empty XMLToken object.
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple, |
XMLAttributes | attributes, | ||
XMLNamespaces | namespaces, | ||
long | line, | ||
long | column | ||
) |
Creates an XML start element with attributes and namespace declarations.
triple | an XMLTriple object describing the start tag. |
attributes | XMLAttributes, the attributes to set on the element to be created. |
namespaces | XMLNamespaces, the namespaces to set on the element to be created. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple, |
XMLAttributes | attributes, | ||
XMLNamespaces | namespaces, | ||
long | line | ||
) |
Creates an XML start element with attributes and namespace declarations.
triple | an XMLTriple object describing the start tag. |
attributes | XMLAttributes, the attributes to set on the element to be created. |
namespaces | XMLNamespaces, the namespaces to set on the element to be created. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple, |
XMLAttributes | attributes, | ||
XMLNamespaces | namespaces | ||
) |
Creates an XML start element with attributes and namespace declarations.
triple | an XMLTriple object describing the start tag. |
attributes | XMLAttributes, the attributes to set on the element to be created. |
namespaces | XMLNamespaces, the namespaces to set on the element to be created. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple, |
XMLAttributes | attributes, | ||
long | line, | ||
long | column | ||
) |
Creates an XML start element with attributes.
triple | an XMLTriple object describing the start tag. |
attributes | XMLAttributes, the attributes to set on the element to be created. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
The XML namespace component of this XMLToken object will be left empty. See the other variants of the XMLToken constructors for versions that take namespace arguments.
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple, |
XMLAttributes | attributes, | ||
long | line | ||
) |
Creates an XML start element with attributes.
triple | an XMLTriple object describing the start tag. |
attributes | XMLAttributes, the attributes to set on the element to be created. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
The XML namespace component of this XMLToken object will be left empty. See the other variants of the XMLToken constructors for versions that take namespace arguments.
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple, |
XMLAttributes | attributes | ||
) |
Creates an XML start element with attributes.
triple | an XMLTriple object describing the start tag. |
attributes | XMLAttributes, the attributes to set on the element to be created. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
The XML namespace component of this XMLToken object will be left empty. See the other variants of the XMLToken constructors for versions that take namespace arguments.
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple, |
long | line, | ||
long | column | ||
) |
Creates an XML end element.
triple | an XMLTriple object describing the end tag. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple, |
long | line | ||
) |
Creates an XML end element.
triple | an XMLTriple object describing the end tag. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | XMLTriple | triple | ) |
Creates an XML end element.
triple | an XMLTriple object describing the end tag. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | string | chars, |
long | line, | ||
long | column | ||
) |
Creates a text object.
chars | a string, the text to be added to the XMLToken object. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | string | chars, |
long | line | ||
) |
Creates a text object.
chars | a string, the text to be added to the XMLToken object. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | string | chars | ) |
Creates a text object.
chars | a string, the text to be added to the XMLToken object. |
line | a long integer, the line number to associate with the token (default = 0). |
column | a long integer, the column number to associate with the token (default = 0). |
libsbmlcs.XMLToken.XMLToken | ( | XMLToken | orig | ) |
int libsbmlcs.XMLToken.addAttr | ( | string | name, |
string | value, | ||
string | namespaceURI, | ||
string | prefix | ||
) |
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.
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.
int libsbmlcs.XMLToken.addAttr | ( | string | name, |
string | value, | ||
string | namespaceURI | ||
) |
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.
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.
int libsbmlcs.XMLToken.addAttr | ( | string | name, |
string | value | ||
) |
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.
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.
int libsbmlcs.XMLToken.addAttr | ( | XMLTriple | triple, |
string | value | ||
) |
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.
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 libsbmlcs.XMLToken.addNamespace | ( | string | uri, |
string | prefix | ||
) |
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.
uri | a string, the XML namespace URI for the namespace. |
prefix | a string, the namespace prefix to use. |
int libsbmlcs.XMLToken.addNamespace | ( | string | uri | ) |
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.
uri | a string, the XML namespace URI for the namespace. |
prefix | a string, the namespace prefix to use. |
int libsbmlcs.XMLToken.append | ( | string | chars | ) |
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. |
int libsbmlcs.XMLToken.clearAttributes | ( | ) |
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.
int libsbmlcs.XMLToken.clearNamespaces | ( | ) |
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.
XMLToken libsbmlcs.XMLToken.clone | ( | ) |
|
virtual |
Reimplemented in libsbmlcs.XMLNode.
override bool libsbmlcs.XMLToken.Equals | ( | Object | sb | ) |
XMLAttributes libsbmlcs.XMLToken.getAttributes | ( | ) |
Returns the attributes of the XML element represented by this token.
int libsbmlcs.XMLToken.getAttributesLength | ( | ) |
int libsbmlcs.XMLToken.getAttrIndex | ( | string | name, |
string | uri | ||
) |
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.int libsbmlcs.XMLToken.getAttrIndex | ( | string | name | ) |
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.int libsbmlcs.XMLToken.getAttrIndex | ( | XMLTriple | triple | ) |
string libsbmlcs.XMLToken.getAttrName | ( | int | index | ) |
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.string libsbmlcs.XMLToken.getAttrPrefix | ( | int | index | ) |
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.string libsbmlcs.XMLToken.getAttrPrefixedName | ( | int | index | ) |
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. string libsbmlcs.XMLToken.getAttrURI | ( | int | index | ) |
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. string libsbmlcs.XMLToken.getAttrValue | ( | int | index | ) |
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. string libsbmlcs.XMLToken.getAttrValue | ( | string | name, |
string | uri | ||
) |
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.string libsbmlcs.XMLToken.getAttrValue | ( | string | name | ) |
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.string libsbmlcs.XMLToken.getAttrValue | ( | XMLTriple | triple | ) |
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. string libsbmlcs.XMLToken.getCharacters | ( | ) |
Returns the character text of token.
long libsbmlcs.XMLToken.getColumn | ( | ) |
Returns the column number at which this token occurs in the input.
override int libsbmlcs.XMLToken.GetHashCode | ( | ) |
long libsbmlcs.XMLToken.getLine | ( | ) |
Returns the line number at which this token occurs in the input.
string libsbmlcs.XMLToken.getName | ( | ) |
Returns the (unqualified) name of token.
int libsbmlcs.XMLToken.getNamespaceIndex | ( | string | uri | ) |
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. int libsbmlcs.XMLToken.getNamespaceIndexByPrefix | ( | string | prefix | ) |
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. string libsbmlcs.XMLToken.getNamespacePrefix | ( | int | index | ) |
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.string libsbmlcs.XMLToken.getNamespacePrefix | ( | string | uri | ) |
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. XMLNamespaces libsbmlcs.XMLToken.getNamespaces | ( | ) |
Returns the XML namespaces declared for this token.
int libsbmlcs.XMLToken.getNamespacesLength | ( | ) |
Returns the number of XML namespaces declared on this token.
string libsbmlcs.XMLToken.getNamespaceURI | ( | int | index | ) |
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.string libsbmlcs.XMLToken.getNamespaceURI | ( | string | prefix | ) |
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.string libsbmlcs.XMLToken.getNamespaceURI | ( | ) |
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.string libsbmlcs.XMLToken.getPrefix | ( | ) |
Returns the XML namespace prefix of token.
string libsbmlcs.XMLToken.getURI | ( | ) |
Returns the XML namespace URI of token.
bool libsbmlcs.XMLToken.hasAttr | ( | int | index | ) |
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 libsbmlcs.XMLToken.hasAttr | ( | string | name, |
string | uri | ||
) |
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.bool libsbmlcs.XMLToken.hasAttr | ( | string | name | ) |
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.bool libsbmlcs.XMLToken.hasAttr | ( | XMLTriple | triple | ) |
bool libsbmlcs.XMLToken.hasNamespaceNS | ( | string | uri, |
string | prefix | ||
) |
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. bool libsbmlcs.XMLToken.hasNamespacePrefix | ( | string | prefix | ) |
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. bool libsbmlcs.XMLToken.hasNamespaceURI | ( | string | uri | ) |
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. bool libsbmlcs.XMLToken.isAttributesEmpty | ( | ) |
Returns true
if this token has no attributes.
true
if the list of attributes on XMLToken object is empty, false
otherwise. bool libsbmlcs.XMLToken.isElement | ( | ) |
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.bool libsbmlcs.XMLToken.isEnd | ( | ) |
Returns true
if this token represents an XML end element.
true
if this XMLToken object represents an XML end element, false
otherwise.bool libsbmlcs.XMLToken.isEndFor | ( | XMLToken | element | ) |
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.bool libsbmlcs.XMLToken.isEOF | ( | ) |
bool libsbmlcs.XMLToken.isNamespacesEmpty | ( | ) |
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. bool libsbmlcs.XMLToken.isStart | ( | ) |
Returns true
if this token represents an XML start element.
true
if this XMLToken is an XML start element, false
otherwise.bool libsbmlcs.XMLToken.isText | ( | ) |
Returns true
if this token represents an XML text element.
true
if this XMLToken is an XML text element, false
otherwise.int libsbmlcs.XMLToken.removeAttr | ( | int | n | ) |
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.
n | an integer the index of the resource to be deleted. |
n
.int libsbmlcs.XMLToken.removeAttr | ( | string | name, |
string | uri | ||
) |
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.
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).int libsbmlcs.XMLToken.removeAttr | ( | string | name | ) |
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.
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).int libsbmlcs.XMLToken.removeAttr | ( | XMLTriple | triple | ) |
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.
triple | an XMLTriple describing the attribute to be removed. |
triple
.int libsbmlcs.XMLToken.removeNamespace | ( | int | index | ) |
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.
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. |
int libsbmlcs.XMLToken.removeNamespace | ( | string | prefix | ) |
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.
prefix | a string, the prefix of the namespace to be removed. |
prefix
on this element.int libsbmlcs.XMLToken.setAttributes | ( | XMLAttributes | attributes | ) |
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.
attributes | an XMLAttributes object to be assigned to this XMLToken object, thereby setting the XML attributes associated with this token. |
attributes
. int libsbmlcs.XMLToken.setCharacters | ( | string | chars | ) |
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. |
int libsbmlcs.XMLToken.setEnd | ( | ) |
Declares that this token represents an XML element end tag.
int libsbmlcs.XMLToken.setEOF | ( | ) |
Declares that this token is an end-of-file/input marker.
int libsbmlcs.XMLToken.setNamespaces | ( | XMLNamespaces | namespaces | ) |
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.
namespaces | the XMLNamespaces object to be assigned to this XMLToken object. |
namespaces
. int libsbmlcs.XMLToken.setTriple | ( | XMLTriple | triple | ) |
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.
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. |
string libsbmlcs.XMLToken.toString | ( | ) |
Prints a string representation of the underlying token stream.
This method is intended for debugging purposes.
int libsbmlcs.XMLToken.unsetEnd | ( | ) |
Declares that this token no longer represents an XML start/end element.
|
protected |