XMLAttributes.h File Reference

Detailed Description

XMLAttributes are a list of name/value pairs for XML elements.

Author:
Ben Bornstein
Include dependency graph for XMLAttributes.h:
This graph shows which files directly or indirectly include this file:

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.
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.
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.
LIBLAX_EXTERN int XMLAttributes_clear (XMLAttributes_t *xa)
 Clears (deletes) all attributes in this XMLAttributes object.
LIBLAX_EXTERN XMLAttributes_t * XMLAttributes_clone (const XMLAttributes_t *c)
 Creates a deep copy of the given XMLAttributes_t structure.
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.
LIBLAX_EXTERN int XMLAttributes_getIndex (const XMLAttributes_t *xa, const char *name)
 Return the index of an attribute with the given name.
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.
LIBLAX_EXTERN int XMLAttributes_getIndexByTriple (const XMLAttributes_t *xa, const XMLTriple_t *triple)
 Return the index of an attribute with the given XML triple.
LIBLAX_EXTERN int XMLAttributes_getLength (const XMLAttributes_t *xa)
 Return the number of attributes in the set.
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).
LIBLAX_EXTERN int XMLAttributes_getNumAttributes (const XMLAttributes_t *xa)
 Return the number of attributes in the set.
LIBLAX_EXTERN char * XMLAttributes_getPrefix (const XMLAttributes_t *xa, int index)
 Return the value of an attribute in this XMLAttributes_t structure (by position).
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).
LIBLAX_EXTERN char * XMLAttributes_getValue (const XMLAttributes_t *xa, int index)
 Return the value of an attribute in this XMLAttributes_t structure (by position).
LIBLAX_EXTERN char * XMLAttributes_getValueByName (const XMLAttributes_t *xa, const char *name)
 Return an attribute's value by name.
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.
LIBLAX_EXTERN char * XMLAttributes_getValueByTriple (const XMLAttributes_t *xa, const XMLTriple_t *triple)
 Return an attribute's value by XMLTriple.
LIBLAX_EXTERN int XMLAttributes_hasAttribute (const XMLAttributes_t *xa, int index)
 Predicate returning true or false depending on whether an attribute with the given index exists in this XMLAttributes_t structure.
LIBLAX_EXTERN int XMLAttributes_hasAttributeWithName (const XMLAttributes_t *xa, const char *name)
 Predicate returning true or false depending on whether an attribute with the given local name exists in this XMLAttributes_t structure.
LIBLAX_EXTERN int XMLAttributes_hasAttributeWithNS (const XMLAttributes_t *xa, const char *name, const char *uri)
 Predicate returning true or false depending on whether an attribute with the given local name and namespace URI exists in this XMLAttributes_t structure.
LIBLAX_EXTERN int XMLAttributes_hasAttributeWithTriple (const XMLAttributes_t *xa, const XMLTriple_t *triple)
 Predicate returning true or false depending on whether an attribute with the given XMLtriple_t exists in this XMLAttributes_t structure.
LIBLAX_EXTERN int XMLAttributes_isEmpty (const XMLAttributes_t *xa)
 Predicate returning true or false depending on whether this XMLAttributes_t structure is empty.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
LIBLAX_EXTERN int XMLAttributes_remove (XMLAttributes_t *xa, int n)
 Removes an attribute (a name/value pair) from this XMLAttributes set.
LIBLAX_EXTERN int XMLAttributes_removeByName (XMLAttributes_t *xa, const char *name)
 Removes an attribute with the given local name from this XMLAttributes set.
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 set.
LIBLAX_EXTERN int XMLAttributes_removeByTriple (XMLAttributes_t *xa, const XMLTriple_t *triple)
 Removes an attribute with the given triple from this XMLAttributes set.
LIBLAX_EXTERN int XMLAttributes_removeResource (XMLAttributes_t *xa, int n)
 Adds an attribute with the given name/value pair to this XMLAttributes_t structure.

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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
Note:
if local name already exists in this attribute set, its value will be replaced.
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.
namespaceURIa 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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
LIBLAX_EXTERN int XMLAttributes_clear ( XMLAttributes_t *  xa)

Clears (deletes) all attributes in this XMLAttributes object.

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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
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.

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 required.
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 required.
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, the XML triple of the attribute for which the index is required.
Returns:
the index of an attribute with the given XMLTriple, 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 XMLNamespaces_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 XMLNamespaces_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 XMLNamespaces_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 required.
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 required.
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.

Parameters:
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute whose value is required.
Returns:
The attribute value as a string. NULL will be returned if the value is empty.
Note:
If an attribute with the given XMLTriple 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 true or 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:
non-zero (true) if an attribute with the given index exists in this XMLAttributes_t structure, zero (false) otherwise.
LIBLAX_EXTERN int XMLAttributes_hasAttributeWithName ( const XMLAttributes_t *  xa,
const char *  name 
)

Predicate returning true or 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:
non-zero (true) if an attribute with the given local name exists in this XMLAttributes_t structure, zero (false) otherwise.
LIBLAX_EXTERN int XMLAttributes_hasAttributeWithNS ( const XMLAttributes_t *  xa,
const char *  name,
const char *  uri 
)

Predicate returning true or 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:
non-zero (true) if an attribute with the given local name and namespace URI exists in this XMLAttributes_t structure, zero (false) otherwise.
LIBLAX_EXTERN int XMLAttributes_hasAttributeWithTriple ( const XMLAttributes_t *  xa,
const XMLTriple_t *  triple 
)

Predicate returning true or 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:
non-zero (true) if an attribute with the given XMLTriple_t exists in this XMLAttributes_t structure, zero (false) otherwise.
LIBLAX_EXTERN int XMLAttributes_isEmpty ( const XMLAttributes_t *  xa)

Predicate returning true or false depending on whether this XMLAttributes_t structure is empty.

Parameters:
xathe XMLAttributes_t structure.
Returns:
non-zero (true) if this XMLAttributes_t structure is empty, zero (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 is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters:
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog_t, the error log.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (false) otherwise.
Note:
A namespace bound to the given local name is not checked by this function. 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 is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters:
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog_t, the error log.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (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 is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters:
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog_t, the error log.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (false) otherwise.
Note:
A namespace bound to the given local name is not checked by this function. 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 is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters:
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog_t, the error log.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (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 is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters:
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog_t, the error log.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (false) otherwise.
Note:
A namespace bound to the given local name is not checked by this function. 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 is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters:
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog_t, the error log.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (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 is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters:
xathe XMLAttributes_t structure.
namea string, the local name of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog_t, the error log.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (false) otherwise.
Note:
A namespace bound to the given local name is not checked by this function. 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 is passed in datatype format errors are logged. If required is true, missing attributes are also logged.

Parameters:
xathe XMLAttributes_t structure.
triplean XMLTriple_t, the XML triple of the attribute.
valuea boolean, the value of the attribute.
logan XMLErrorLog_t, the error log.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (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 is passed in datatype format errors are logged. If required is 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.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (false) otherwise.
Note:
A namespace bound to the given local name is not checked by this function. 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 is passed in datatype format errors are logged. If required is 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.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (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 is passed in datatype format errors are logged. If required is 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.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (false) otherwise.
Note:
A namespace bound to the given local name is not checked by this function. 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 is passed in datatype format errors are logged. If required is 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.
requireda boolean, indicating whether the attribute is required.
Returns:
non-zero (true) if the attribute was read into value, zero (false) otherwise.
LIBLAX_EXTERN int XMLAttributes_remove ( XMLAttributes_t *  xa,
int  n 
)

Removes an attribute (a name/value pair) from this XMLAttributes 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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INDEX_EXCEEDS_SIZE
  • LIBSBML_INVALID_OBJECT
LIBLAX_EXTERN int XMLAttributes_removeByName ( XMLAttributes_t *  xa,
const char *  name 
)

Removes an attribute with the given local name from this XMLAttributes 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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INDEX_EXCEEDS_SIZE
  • LIBSBML_INVALID_OBJECT
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 set.

Parameters:
xathe XMLAttributes_t structure.
namea string, the local name of the attribute for which the index is required.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INDEX_EXCEEDS_SIZE
  • LIBSBML_INVALID_OBJECT
LIBLAX_EXTERN int XMLAttributes_removeByTriple ( XMLAttributes_t *  xa,
const XMLTriple_t *  triple 
)

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

Parameters:
xathe XMLAttributes_t structure.
triplean XMLTriple, the XML triple of the attribute for which the index is required.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INDEX_EXCEEDS_SIZE
  • LIBSBML_INVALID_OBJECT
LIBLAX_EXTERN int XMLAttributes_removeResource ( XMLAttributes_t *  xa,
int  n 
)

Adds an attribute with the given name/value pair to this XMLAttributes_t structure.

This method is similar to the add method but an attribute with same name wont be overwritten. This facilitates the addition of multiple resource attributes to a annotations.

Parameters:
xathe XMLAttributes_t structure.
namea string, the name of the attribute.
valuea string, the value of the attribute. LIBLAX_EXTERN void XMLAttributes_addResource (XMLAttributes_t *xa, const char *name, const char *value) { xa->addResource(name, value); } Removes an attribute (a name/value pair) from this XMLAttributes set.
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:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INDEX_EXCEEDS_SIZE
  • LIBSBML_INVALID_OBJECT
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines