libSBML C API  5.18.0
XMLAttributes_t Class Reference

Detailed Description

A list of attributes on an XML element.

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.

Note
Note that although XMLAttributes_t provides operations that can manipulate attributes based on a numerical index, XML attributes are in fact unordered when they appear in files and data streams. The XMLAttributes_t class provides some list-like facilities, but it is only for the convenience of callers. (For example, it permits callers to loop across all attributes more easily.) Users should keep in mind that the order in which attributes are stored in XMLAttributes_t objects has no real impact on the order in which the attributes are read or written from an XML file or data stream.
See also
XMLTriple_t
XMLNode_t
XMLToken_t
Examples:
addingEvidenceCodes_2.c, and createExampleSBML.c.

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_tXMLAttributes_clone (const XMLAttributes_t *att)
 Creates a deep copy of the given XMLAttributes_t structure. More...
 
LIBLAX_EXTERN XMLAttributes_tXMLAttributes_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...
 

Member Function Documentation

LIBLAX_EXTERN int XMLAttributes_add ( XMLAttributes_t xa,
const char *  name,
const char *  value 
)

Adds a name/value pair to this XMLAttributes_t structure.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea string, the value of the attribute.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
if local name already exists in this list of attributes, its value will be replaced.
Examples:
addingEvidenceCodes_2.c.
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea string, the value of the attribute.
uria string, the namespace URI of the attribute.
prefixa string, the prefix of the namespace.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
if local name with the same namespace URI already exists in this attribute set, its value will be replaced.
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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the triple of the attribute.
valuea string, the value of the attribute.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
LIBLAX_EXTERN int XMLAttributes_clear ( XMLAttributes_t xa)

Clears (deletes) all attributes in this XMLAttributes_t structure.

Parameters
xathe XMLAttributes_t structure.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Examples:
addingEvidenceCodes_2.c.
LIBLAX_EXTERN XMLAttributes_t * XMLAttributes_clone ( const XMLAttributes_t att)

Creates a deep copy of the given XMLAttributes_t structure.

Parameters
attthe XMLAttributes_t structure to be copied.
Returns
a (deep) copy of the given XMLAttributes_t structure.
LIBLAX_EXTERN XMLAttributes_t * XMLAttributes_create ( void  )

Creates a new empty XMLAttributes_t set.

Examples:
addingEvidenceCodes_2.c, and createExampleSBML.c.
LIBLAX_EXTERN void XMLAttributes_free ( XMLAttributes_t xa)

Frees the given XMLAttributes_t structure.

Parameters
xathe 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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute for which the index is being sought.
Returns
the index of an attribute with the given local name, or -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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute for which the index is being sought.
uria string, the namespace URI of the attribute.
Returns
the index of an attribute with the given local name and namespace URI, or -1 if 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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute for which the index is being sought.
Returns
the index of an attribute with the given XMLTriple_t, or -1 if not present.
LIBLAX_EXTERN int XMLAttributes_getLength ( const XMLAttributes_t xa)

Return the number of attributes in the set.

Parameters
xathe XMLAttributes_t structure.
Returns
the number of attributes in this 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).

Parameters
xathe XMLAttributes_t structure.
indexan integer, the position of the attribute whose name is required.
Returns
the local name of an attribute in this list (by position). NULL will be returned if the name is empty.
Note
If index is out of range, an empty string will be returned. Use XMLAttributes_hasAttribute() != 0 to test for attribute existence. to test for attribute existence. Returned const char* should be freed with safe_free() by the caller.
LIBLAX_EXTERN int XMLAttributes_getNumAttributes ( const XMLAttributes_t xa)

Return the number of attributes in the set.

Parameters
xathe XMLAttributes_t structure.
Returns
the number of attributes in this 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).

Parameters
xathe XMLAttributes_t structure.
indexan integer, the position of the attribute whose value is required.
Returns
the value of an attribute in the list (by position). NULL will be returned if the prefix is empty.
Note
If index is out of range, an empty string will be returned. Use XMLAttributes_hasAttribute() != 0 to test for attribute existence. Returned const char* should be freed with safe_free() by the caller.
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).

Parameters
xathe XMLAttributes_t structure.
indexan integer, the position of the attribute whose namespace URI is required.
Returns
the namespace URI of an attribute in this list (by position). NULL will be returned if the URI is empty.
Note
If index is out of range, an empty string will be returned. Use XMLAttributes_hasAttribute() != 0 to test for attribute existence. Returned const char* should be freed with safe_free() by the caller.
LIBLAX_EXTERN char * XMLAttributes_getValue ( const XMLAttributes_t xa,
int  index 
)

Return the value of an attribute in this XMLAttributes_t structure (by position).

Parameters
xathe XMLAttributes_t structure.
indexan integer, the position of the attribute whose value is required.
Returns
the value of an attribute in the list (by position). NULL will be returned if the value is empty.
Note
If index is out of range, NULL will be returned. Use XMLAttributes_hasAttribute() != 0 to test for attribute existence. Returned const char* should be freed with safe_free() by the caller.
LIBLAX_EXTERN char * XMLAttributes_getValueByName ( const XMLAttributes_t xa,
const char *  name 
)

Return an attribute's value by name.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute whose value is being sought.
Returns
The attribute value as a string. NULL will be returned if the value is empty.
Note
If an attribute with the given local name does not exist, NULL will be returned. Use XMLAttributes_hasAttributeWithName() != 0 to test for attribute existence. A namespace bound to the local name is not checked by this function. Thus, if there are multiple attributes with the given local name and different namespaces, the value of an attribute with the smallest index among those attributes will be returned. XMLAttributes_getValueByNS() or XMLAttributes_getValueByTriple() should be used to get a value of an attribute with the given local name and namespace. Returned const char* should be freed with safe_free() by the caller.
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute whose value is being sought.
uria string, the namespace URI of the attribute.
Returns
The attribute value as a string. NULL will be returned if the value is empty.
Note
If an attribute with the given local name and namespace URI does not exist, an empty string will be returned. Use XMLAttributes_hasAttributeWithNS() to test for attribute existence. Returned const char* should be freed with safe_free() by the caller.
LIBLAX_EXTERN char * XMLAttributes_getValueByTriple ( const XMLAttributes_t xa,
const XMLTriple_t triple 
)

Return an attribute's value by XMLTriple_t.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute whose value is being sought.
Returns
The attribute value as a string. NULL will be returned if the value is empty.
Note
If an attribute with the given XMLTriple_t does not exist, NULL will be returned. Use XMLAttributes_hasAttributeWithTriple() != 0 to test for attribute existence. Returned const char* should be freed with safe_free() by the caller.
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.

Parameters
xathe XMLAttributes_t structure.
indexan integer, the position of the attribute.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
uria string, the namespace URI of the attribute.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuean integer representing a Boolean, with zero (0) = false, and nonzero = true; the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
1 (true) if the attribute was read into value, 0 (false) otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes_readIntoBooleanByTriple() should be used to read a value for an attribute name with a prefix and namespace.
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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuean integer representing a Boolean, with zero (0) = false, and nonzero = true; the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea double, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
1 (true) if the attribute was read into value, 0 (false) otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes_readIntoDoubleByTriple() should be used to read a value for an attribute name with a prefix and namespace.
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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuea double, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuean integer, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
1 (true) if the attribute was read into value, 0 (false) otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes_readIntoIntByTriple() should be used to read a value for an attribute name with a prefix and namespace.
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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuean integer, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea long, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
1 (true) if the attribute was read into value, 0 (false) otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes_readIntoLongByTriple() should be used to read a value for an attribute name with a prefix and namespace.
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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuea long, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea string, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
1 (true) if the attribute was read into value, 0 (false) otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes_readIntoStringByTriple() should be used to read a value for an attribute name with a prefix and namespace.
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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuea string, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuean unsigned int, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
1 (true) if the attribute was read into value, 0 (false) otherwise.
Note
A namespace bound to the given local name is not checked by this function. XMLAttributes_readIntoUnsignedIntByTriple() should be used to read a value for an attribute name with a prefix and namespace.
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.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuean unsigned int, the value of the attribute.
logan XMLErrorLog_t, the error log.
requiredan integer representing a Boolean, with zero (0) = false, and nonzero = true, indicating whether the attribute is being sought.
Returns
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.

Parameters
xathe XMLAttributes_t structure.
nan integer the index of the resource to be deleted.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
LIBLAX_EXTERN int XMLAttributes_removeByName ( XMLAttributes_t xa,
const char *  name 
)

Removes an attribute with the given local name from this XMLAttributes_t set.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
Note
A prefix and namespace URI bound to the local name are set to empty in this function. XMLAttributes_removeByNS(name,uri) or XMLAttributes_removeByTriple(triple) should be used to remove an attribute with the given local name and namespace.
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.

Parameters
xathe XMLAttributes_t structure.
namea string, the local name of the attribute for which the index is being sought.
uria string, the namespace URI of the attribute.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
LIBLAX_EXTERN int XMLAttributes_removeByTriple ( XMLAttributes_t xa,
const XMLTriple_t triple 
)

Removes an attribute with the given triple from this XMLAttributes_t set.

Parameters
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute for which the index is being sought.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are:
LIBLAX_EXTERN int XMLAttributes_removeResource ( XMLAttributes_t xa,
int  n 
)

Removes an attribute (a name/value pair) from this XMLAttributes_t set.

Parameters
xathe XMLAttributes_t structure.
nan integer the index of the resource to be deleted.
Returns
integer value indicating success/failure of the function. The value is drawn from the enumeration OperationReturnValues_t. The possible values returned by this function are: