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.
In libSBML's XML interface layer, attributes on an element are stored as a list of values kept in an XMLAttributes_t object. XMLAttributes_t has methods for adding and removing individual attributes as well as performing other actions on the list of attributes. Classes in libSBML that represent nodes in an XML document (i.e., XMLNode_t and its parent class, XMLToken_t) use XMLAttributes_t objects to manage attributes on XML elements.
Attributes on an XML element can be written in one of two forms:
name="value"
prefix:name="value"
An attribute in XML must always have a value, and the value must always be a quoted string; i.e., it is always name="value"
and not name=value
. An empty value is represented simply as an empty string; i.e., name=""
.
In cases when a prefix
is provided with an attribute name, general XML validity rules require that the prefix is an XML namespace prefix that has been declared somewhere else (possibly as an another attribute on the same element). However, the XMLAttributes_t class does not test for the proper existence or declaration of XML namespaces—callers must arrange to do this themselves in some other way. This class only provides facilities for tracking and manipulating attributes and their prefix/URI/name/value components.
Public Member Functions | |
LIBLAX_EXTERN int | XMLAttributes_add (XMLAttributes_t *xa, const char *name, const char *value) |
Adds a name/value pair to this XMLAttributes_t structure. More... | |
LIBLAX_EXTERN int | XMLAttributes_addWithNamespace (XMLAttributes_t *xa, const char *name, const char *value, const char *uri, const char *prefix) |
Adds a name/value pair to this XMLAttributes_t structure with a prefix and URI defining a namespace. More... | |
LIBLAX_EXTERN int | XMLAttributes_addWithTriple (XMLAttributes_t *xa, const XMLTriple_t *triple, const char *value) |
Adds an attribute with the given XMLtriple/value pair to this XMLAttributes_t structure. More... | |
LIBLAX_EXTERN int | XMLAttributes_clear (XMLAttributes_t *xa) |
Clears (deletes) all attributes in this XMLAttributes_t structure. More... | |
LIBLAX_EXTERN XMLAttributes_t * | XMLAttributes_clone (const XMLAttributes_t *att) |
Creates a deep copy of the given XMLAttributes_t structure. More... | |
LIBLAX_EXTERN XMLAttributes_t * | XMLAttributes_create (void) |
Creates a new empty XMLAttributes_t set. More... | |
LIBLAX_EXTERN void | XMLAttributes_free (XMLAttributes_t *xa) |
Frees the given XMLAttributes_t structure. More... | |
LIBLAX_EXTERN int | XMLAttributes_getIndex (const XMLAttributes_t *xa, const char *name) |
Return the index of an attribute with the given name. More... | |
LIBLAX_EXTERN int | XMLAttributes_getIndexByNS (const XMLAttributes_t *xa, const char *name, const char *uri) |
Return the index of an attribute with the given name and namespace URI. More... | |
LIBLAX_EXTERN int | XMLAttributes_getIndexByTriple (const XMLAttributes_t *xa, const XMLTriple_t *triple) |
Return the index of an attribute with the given XML triple. More... | |
LIBLAX_EXTERN int | XMLAttributes_getLength (const XMLAttributes_t *xa) |
Return the number of attributes in the set. More... | |
LIBLAX_EXTERN char * | XMLAttributes_getName (const XMLAttributes_t *xa, int index) |
Return the local name of an attribute in this XMLAttributes_t structure (by position). More... | |
LIBLAX_EXTERN int | XMLAttributes_getNumAttributes (const XMLAttributes_t *xa) |
Return the number of attributes in the set. More... | |
LIBLAX_EXTERN char * | XMLAttributes_getPrefix (const XMLAttributes_t *xa, int index) |
Return the value of an attribute in this XMLAttributes_t structure (by position). More... | |
LIBLAX_EXTERN char * | XMLAttributes_getURI (const XMLAttributes_t *xa, int index) |
Return the namespace URI of an attribute in this XMLAttributes_t structure (by position). More... | |
LIBLAX_EXTERN char * | XMLAttributes_getValue (const XMLAttributes_t *xa, int index) |
Return the value of an attribute in this XMLAttributes_t structure (by position). More... | |
LIBLAX_EXTERN char * | XMLAttributes_getValueByName (const XMLAttributes_t *xa, const char *name) |
Return an attribute's value by name. More... | |
LIBLAX_EXTERN char * | XMLAttributes_getValueByNS (const XMLAttributes_t *xa, const char *name, const char *uri) |
Return a value of an attribute with the given local name and namespace URI. More... | |
LIBLAX_EXTERN char * | XMLAttributes_getValueByTriple (const XMLAttributes_t *xa, const XMLTriple_t *triple) |
Return an attribute's value by XMLTriple_t. More... | |
LIBLAX_EXTERN int | XMLAttributes_hasAttribute (const XMLAttributes_t *xa, int index) |
Predicate returning 1 (true) or 0 (false) depending on whether an attribute with the given index exists in this XMLAttributes_t structure. More... | |
LIBLAX_EXTERN int | XMLAttributes_hasAttributeWithName (const XMLAttributes_t *xa, const char *name) |
Predicate returning 1 (true) or 0 (false) depending on whether an attribute with the given local name exists in this XMLAttributes_t structure. More... | |
LIBLAX_EXTERN int | XMLAttributes_hasAttributeWithNS (const XMLAttributes_t *xa, const char *name, const char *uri) |
Predicate returning 1 (true) or 0 (false) depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes_t structure. More... | |
LIBLAX_EXTERN int | XMLAttributes_hasAttributeWithTriple (const XMLAttributes_t *xa, const XMLTriple_t *triple) |
Predicate returning 1 (true) or 0 (false) depending on whether an attribute with the given XMLtriple_t exists in this XMLAttributes_t structure. More... | |
LIBLAX_EXTERN int | XMLAttributes_isEmpty (const XMLAttributes_t *xa) |
Predicate returning 1 (true) or 0 (false) depending on whether this XMLAttributes_t structure is empty. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoBoolean (XMLAttributes_t *xa, const char *name, int *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute name into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoBooleanByTriple (XMLAttributes_t *xa, const XMLTriple_t *triple, int *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute with the given XMLTriple_t into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoDouble (XMLAttributes_t *xa, const char *name, double *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute name into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoDoubleByTriple (XMLAttributes_t *xa, const XMLTriple_t *triple, double *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute with the given XMLTriple_t into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoInt (XMLAttributes_t *xa, const char *name, int *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute name into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoIntByTriple (XMLAttributes_t *xa, const XMLTriple_t *triple, int *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute with the given XMLTriple_t into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoLong (XMLAttributes_t *xa, const char *name, long *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute name into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoLongByTriple (XMLAttributes_t *xa, const XMLTriple_t *triple, long *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute with the given XMLTriple_t into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoString (XMLAttributes_t *xa, const char *name, char **value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute name into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoStringByTriple (XMLAttributes_t *xa, const XMLTriple_t *triple, char **value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute with the given XMLTriple_t into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoUnsignedInt (XMLAttributes_t *xa, const char *name, unsigned int *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute name into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_readIntoUnsignedIntByTriple (XMLAttributes_t *xa, const XMLTriple_t *triple, unsigned int *value, XMLErrorLog_t *log, int required) |
Reads the value for the attribute with the given XMLTriple_t into value. More... | |
LIBLAX_EXTERN int | XMLAttributes_remove (XMLAttributes_t *xa, int n) |
Removes an attribute (a name/value pair) from this XMLAttributes_t set. More... | |
LIBLAX_EXTERN int | XMLAttributes_removeByName (XMLAttributes_t *xa, const char *name) |
Removes an attribute with the given local name from this XMLAttributes_t set. More... | |
LIBLAX_EXTERN int | XMLAttributes_removeByNS (XMLAttributes_t *xa, const char *name, const char *uri) |
Removes an attribute with the given name and namespace URI from this XMLAttributes_t set. More... | |
LIBLAX_EXTERN int | XMLAttributes_removeByTriple (XMLAttributes_t *xa, const XMLTriple_t *triple) |
Removes an attribute with the given triple from this XMLAttributes_t set. More... | |
LIBLAX_EXTERN int | XMLAttributes_removeResource (XMLAttributes_t *xa, int n) |
Removes an attribute (a name/value pair) from this XMLAttributes_t set. More... | |
LIBLAX_EXTERN int XMLAttributes_add | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
const char * | value | ||
) |
Adds a name/value pair to this XMLAttributes_t structure.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
value | a string, the value of the attribute. |
LIBLAX_EXTERN int XMLAttributes_addWithNamespace | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
const char * | value, | ||
const char * | uri, | ||
const char * | prefix | ||
) |
Adds a name/value pair to this XMLAttributes_t structure with a prefix and URI defining a namespace.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
value | a string, the value of the attribute. |
uri | a string, the namespace URI of the attribute. |
prefix | a string, the prefix of the namespace. |
LIBLAX_EXTERN int XMLAttributes_addWithTriple | ( | XMLAttributes_t * | xa, |
const XMLTriple_t * | triple, | ||
const char * | value | ||
) |
Adds an attribute with the given XMLtriple/value pair to this XMLAttributes_t structure.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the triple of the attribute. |
value | a string, the value of the attribute. |
LIBLAX_EXTERN int XMLAttributes_clear | ( | XMLAttributes_t * | xa | ) |
Clears (deletes) all attributes in this XMLAttributes_t structure.
xa | the XMLAttributes_t structure. |
LIBLAX_EXTERN XMLAttributes_t * XMLAttributes_clone | ( | const XMLAttributes_t * | att | ) |
Creates a deep copy of the given XMLAttributes_t structure.
att | the XMLAttributes_t structure to be copied. |
LIBLAX_EXTERN XMLAttributes_t * XMLAttributes_create | ( | void | ) |
Creates a new empty XMLAttributes_t set.
LIBLAX_EXTERN void XMLAttributes_free | ( | XMLAttributes_t * | xa | ) |
Frees the given XMLAttributes_t structure.
xa | the XMLAttributes_t structure to be freed. |
LIBLAX_EXTERN int XMLAttributes_getIndex | ( | const XMLAttributes_t * | xa, |
const char * | name | ||
) |
Return the index of an attribute with the given name.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute for which the index is being sought. |
-1
if not present. LIBLAX_EXTERN int XMLAttributes_getIndexByNS | ( | const XMLAttributes_t * | xa, |
const char * | name, | ||
const char * | uri | ||
) |
Return the index of an attribute with the given name and namespace URI.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute for which the index is being sought. |
uri | a string, the namespace URI of the attribute. |
-1
if not present. LIBLAX_EXTERN int XMLAttributes_getIndexByTriple | ( | const XMLAttributes_t * | xa, |
const XMLTriple_t * | triple | ||
) |
Return the index of an attribute with the given XML triple.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute for which the index is being sought. |
-1
if not present. LIBLAX_EXTERN int XMLAttributes_getLength | ( | const XMLAttributes_t * | xa | ) |
Return the number of attributes in the set.
xa | the XMLAttributes_t structure. |
LIBLAX_EXTERN char * XMLAttributes_getName | ( | const XMLAttributes_t * | xa, |
int | index | ||
) |
Return the local name of an attribute in this XMLAttributes_t structure (by position).
xa | the XMLAttributes_t structure. |
index | an integer, the position of the attribute whose name is required. |
LIBLAX_EXTERN int XMLAttributes_getNumAttributes | ( | const XMLAttributes_t * | xa | ) |
Return the number of attributes in the set.
xa | the XMLAttributes_t structure. |
LIBLAX_EXTERN char * XMLAttributes_getPrefix | ( | const XMLAttributes_t * | xa, |
int | index | ||
) |
Return the value of an attribute in this XMLAttributes_t structure (by position).
xa | the XMLAttributes_t structure. |
index | an integer, the position of the attribute whose value is required. |
LIBLAX_EXTERN char * XMLAttributes_getURI | ( | const XMLAttributes_t * | xa, |
int | index | ||
) |
Return the namespace URI of an attribute in this XMLAttributes_t structure (by position).
xa | the XMLAttributes_t structure. |
index | an integer, the position of the attribute whose namespace URI is required. |
LIBLAX_EXTERN char * XMLAttributes_getValue | ( | const XMLAttributes_t * | xa, |
int | index | ||
) |
Return the value of an attribute in this XMLAttributes_t structure (by position).
xa | the XMLAttributes_t structure. |
index | an integer, the position of the attribute whose value is required. |
LIBLAX_EXTERN char * XMLAttributes_getValueByName | ( | const XMLAttributes_t * | xa, |
const char * | name | ||
) |
Return an attribute's value by name.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute whose value is being sought. |
LIBLAX_EXTERN char * XMLAttributes_getValueByNS | ( | const XMLAttributes_t * | xa, |
const char * | name, | ||
const char * | uri | ||
) |
Return a value of an attribute with the given local name and namespace URI.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute whose value is being sought. |
uri | a string, the namespace URI of the attribute. |
LIBLAX_EXTERN char * XMLAttributes_getValueByTriple | ( | const XMLAttributes_t * | xa, |
const XMLTriple_t * | triple | ||
) |
Return an attribute's value by XMLTriple_t.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute whose value is being sought. |
LIBLAX_EXTERN int XMLAttributes_hasAttribute | ( | const XMLAttributes_t * | xa, |
int | index | ||
) |
Predicate returning 1
(true) or 0
(false) depending on whether an attribute with the given index exists in this XMLAttributes_t structure.
xa | the XMLAttributes_t structure. |
index | an integer, the position of the attribute. |
1
(true) if an attribute with the given index exists in this XMLAttributes_t structure, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_hasAttributeWithName | ( | const XMLAttributes_t * | xa, |
const char * | name | ||
) |
Predicate returning 1
(true) or 0
(false) depending on whether an attribute with the given local name exists in this XMLAttributes_t structure.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
1
(true) if an attribute with the given local name exists in this XMLAttributes_t structure, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_hasAttributeWithNS | ( | const XMLAttributes_t * | xa, |
const char * | name, | ||
const char * | uri | ||
) |
Predicate returning 1
(true) or 0
(false) depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes_t structure.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
uri | a string, the namespace URI of the attribute. |
1
(true) if an attribute with the given local name and namespace URI exists in this XMLAttributes_t structure, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_hasAttributeWithTriple | ( | const XMLAttributes_t * | xa, |
const XMLTriple_t * | triple | ||
) |
Predicate returning 1
(true) or 0
(false) depending on whether an attribute with the given XMLtriple_t exists in this XMLAttributes_t structure.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute. |
1
(true) if an attribute with the given XMLTriple_t exists in this XMLAttributes_t structure, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_isEmpty | ( | const XMLAttributes_t * | xa | ) |
Predicate returning 1
(true) or 0
(false) depending on whether this XMLAttributes_t structure is empty.
xa | the XMLAttributes_t structure. |
1
(true) if this XMLAttributes_t structure is empty, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_readIntoBoolean | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
int * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute name into value.
If the given local name was not found or value could be interpreted as a Boolean, value is not modified.
According to the W3C XML Schema, valid boolean values are: "true", "false", "1", and "0" (case-insensitive). For more information, see: http://www.w3.org/TR/xmlschema-2/#boolean
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
value | an integer representing a Boolean, with zero (0) = false, and nonzero = true; the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise.LIBLAX_EXTERN int XMLAttributes_readIntoBooleanByTriple | ( | XMLAttributes_t * | xa, |
const XMLTriple_t * | triple, | ||
int * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute with the given XMLTriple_t into value.
If the XMLTriple_t was not found or value could be interpreted as a Boolean, value is not modified.
According to the W3C XML Schema, valid boolean values are: "true", "false", "1", and "0" (case-insensitive). For more information, see: http://www.w3.org/TR/xmlschema-2/#boolean
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute. |
value | an integer representing a Boolean, with zero (0) = false, and nonzero = true; the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_readIntoDouble | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
double * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute name into value.
If the given local name was not found or value could be interpreted as a double, value is not modified.
According to the W3C XML Schema, valid doubles are the same as valid doubles for C and the special values "INF", "-INF", and "NaN" (case-sensitive). For more information, see: http://www.w3.org/TR/xmlschema-2/#double
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
value | a double, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise.LIBLAX_EXTERN int XMLAttributes_readIntoDoubleByTriple | ( | XMLAttributes_t * | xa, |
const XMLTriple_t * | triple, | ||
double * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute with the given XMLTriple_t into value.
If the XMLTriple_t was not found or value could be interpreted as a double, value is not modified.
According to the W3C XML Schema, valid doubles are the same as valid doubles for C and the special values "INF", "-INF", and "NaN" (case-sensitive). For more information, see: http://www.w3.org/TR/xmlschema-2/#double
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute. |
value | a double, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_readIntoInt | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
int * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute name into value.
If the given local name was not found or value could be interpreted as an integer, value is not modified.
According to the W3C XML Schema valid integers include zero, all positive and all negative whole numbers. For practical purposes, we limit values to what can be stored in a int. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
value | an integer, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise.LIBLAX_EXTERN int XMLAttributes_readIntoIntByTriple | ( | XMLAttributes_t * | xa, |
const XMLTriple_t * | triple, | ||
int * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute with the given XMLTriple_t into value.
If the XMLTriple_t was not found or value could be interpreted as an integer, value is not modified.
According to the W3C XML Schema valid integers include zero, all positive and all negative whole numbers. For practical purposes, we limit values to what can be stored in a int. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute. |
value | an integer, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_readIntoLong | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
long * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute name into value.
If the given local name was not found or value could be interpreted as a long, value is not modified.
According to the W3C XML Schema valid integers include zero, all positive and all negative whole numbers. For practical purposes, we limit values to what can be stored in a long. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
value | a long, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise.LIBLAX_EXTERN int XMLAttributes_readIntoLongByTriple | ( | XMLAttributes_t * | xa, |
const XMLTriple_t * | triple, | ||
long * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute with the given XMLTriple_t into value.
If the XMLTriple_t was not found or value could be interpreted as a long, value is not modified.
According to the W3C XML Schema valid integers include zero, all positive and all negative whole numbers. For practical purposes, we limit values to what can be stored in a long. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute. |
value | a long, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_readIntoString | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
char ** | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute name into value.
If the given local name was not found, value is not modified.
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
value | a string, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise.LIBLAX_EXTERN int XMLAttributes_readIntoStringByTriple | ( | XMLAttributes_t * | xa, |
const XMLTriple_t * | triple, | ||
char ** | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute with the given XMLTriple_t into value.
If the XMLTriple_t was not found, value is not modified.
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute. |
value | a string, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_readIntoUnsignedInt | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
unsigned int * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute name into value.
If the given local name was not found or value could be interpreted as an unsigned int, value is not modified.
According to the W3C XML Schema valid integers include zero, all positive and all negative whole numbers. For practical purposes, we limit values to what can be stored in a unsigned int. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
value | an unsigned int, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise.LIBLAX_EXTERN int XMLAttributes_readIntoUnsignedIntByTriple | ( | XMLAttributes_t * | xa, |
const XMLTriple_t * | triple, | ||
unsigned int * | value, | ||
XMLErrorLog_t * | log, | ||
int | required | ||
) |
Reads the value for the attribute with the given XMLTriple_t into value.
If the XMLTriple_t was not found or value could be interpreted as an unsigned integer, value is not modified.
According to the W3C XML Schema valid integers include zero, all positive and all negative whole numbers. For practical purposes, we limit values to what can be stored in a unsigned int. For more information, see: http://www.w3.org/TR/xmlschema-2/#integer
If an XMLErrorLog_t is passed in datatype format errors are logged. If required
is nonzero
(true), missing attributes are also logged.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute. |
value | an unsigned int, the value of the attribute. |
log | an XMLErrorLog_t, the error log. |
required | an integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought. |
1
(true) if the attribute was read into value, 0
(false) otherwise. LIBLAX_EXTERN int XMLAttributes_remove | ( | XMLAttributes_t * | xa, |
int | n | ||
) |
Removes an attribute (a name/value pair) from this XMLAttributes_t set.
xa | the XMLAttributes_t structure. |
n | an integer the index of the resource to be deleted. |
LIBLAX_EXTERN int XMLAttributes_removeByName | ( | XMLAttributes_t * | xa, |
const char * | name | ||
) |
Removes an attribute with the given local name from this XMLAttributes_t set.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute. |
LIBLAX_EXTERN int XMLAttributes_removeByNS | ( | XMLAttributes_t * | xa, |
const char * | name, | ||
const char * | uri | ||
) |
Removes an attribute with the given name and namespace URI from this XMLAttributes_t set.
xa | the XMLAttributes_t structure. |
name | a string, the local name of the attribute for which the index is being sought. |
uri | a string, the namespace URI of the attribute. |
LIBLAX_EXTERN int XMLAttributes_removeByTriple | ( | XMLAttributes_t * | xa, |
const XMLTriple_t * | triple | ||
) |
Removes an attribute with the given triple from this XMLAttributes_t set.
xa | the XMLAttributes_t structure. |
triple | an XMLTriple_t, the XML triple of the attribute for which the index is being sought. |
LIBLAX_EXTERN int XMLAttributes_removeResource | ( | XMLAttributes_t * | xa, |
int | n | ||
) |
Removes an attribute (a name/value pair) from this XMLAttributes_t set.
xa | the XMLAttributes_t structure. |
n | an integer the index of the resource to be deleted. |