XMLNamespaces.h File Reference

Detailed Description

A list of XMLNamespace declarations (URI/prefix pairs)

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

Functions

LIBLAX_EXTERN int XMLNamespaces_add (XMLNamespaces_t *ns, const char *uri, const char *prefix)
 Appends an XML namespace prefix/URI pair to this XMLNamespaces_t structure.
LIBLAX_EXTERN int XMLNamespaces_clear (XMLNamespaces_t *ns)
 Clears this XMLNamespaces_t structure.
LIBLAX_EXTERN XMLNamespaces_t * XMLNamespaces_clone (const XMLNamespaces_t *c)
 Creates a deep copy of the given XMLNamespaces_t structure.
LIBLAX_EXTERN XMLNamespaces_t * XMLNamespaces_create (void)
 Creates a new empty XMLNamespaces_t structure.
LIBLAX_EXTERN void XMLNamespaces_free (XMLNamespaces_t *ns)
 Frees the given XMLNamespaces_t structure.
LIBLAX_EXTERN int XMLNamespaces_getIndex (const XMLNamespaces_t *ns, const char *uri)
 Lookup the index of an XML namespace declaration by URI.
LIBLAX_EXTERN int XMLNamespaces_getIndexByPrefix (const XMLNamespaces_t *ns, const char *prefix)
 Look up the index of an XML namespace declaration by Prefix.
LIBLAX_EXTERN int XMLNamespaces_getLength (const XMLNamespaces_t *ns)
LIBLAX_EXTERN int XMLNamespaces_getNumNamespaces (const XMLNamespaces_t *ns)
LIBLAX_EXTERN char * XMLNamespaces_getPrefix (const XMLNamespaces_t *ns, int index)
LIBLAX_EXTERN char * XMLNamespaces_getPrefixByURI (const XMLNamespaces_t *ns, const char *uri)
LIBLAX_EXTERN char * XMLNamespaces_getURI (const XMLNamespaces_t *ns, int index)
LIBLAX_EXTERN char * XMLNamespaces_getURIByPrefix (const XMLNamespaces_t *ns, const char *prefix)
LIBLAX_EXTERN int XMLNamespaces_hasNS (const XMLNamespaces_t *ns, const char *uri, const char *prefix)
 Predicate returning true or false depending on whether an XML Namespace with the given URI is contained in this XMLNamespaces list.
LIBLAX_EXTERN int XMLNamespaces_hasPrefix (const XMLNamespaces_t *ns, const char *prefix)
 Predicate returning true or false depending on whether an XML Namespace the given Prefix is contained in this XMLNamespaces list.
LIBLAX_EXTERN int XMLNamespaces_hasURI (const XMLNamespaces_t *ns, const char *uri)
 Predicate returning true or false depending on whether an XML Namespace with the given URI is contained in this XMLNamespaces list.
LIBLAX_EXTERN int XMLNamespaces_isEmpty (const XMLNamespaces_t *ns)
 Predicate returning true or false depending on whether this XMLNamespaces list is empty.
LIBLAX_EXTERN int XMLNamespaces_remove (XMLNamespaces_t *ns, int index)
 Removes an XML Namespace stored in the given position of this list.
LIBLAX_EXTERN int XMLNamespaces_removeByPrefix (XMLNamespaces_t *ns, const char *prefix)
 Removes an XML Namespace with the given Prefix.

Function Documentation

LIBLAX_EXTERN int XMLNamespaces_add ( XMLNamespaces_t *  ns,
const char *  uri,
const char *  prefix 
)

Appends an XML namespace prefix/URI pair to this XMLNamespaces_t structure.

Parameters:
nsXMLNamespaces structure.
uria string, the uri for the namespace.
prefixa string, the prefix for 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
LIBLAX_EXTERN int XMLNamespaces_clear ( XMLNamespaces_t *  ns)

Clears this XMLNamespaces_t structure.

Parameters:
nsXMLNamespaces 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_OPERATION_FAILED
LIBLAX_EXTERN XMLNamespaces_t* XMLNamespaces_clone ( const XMLNamespaces_t *  ns)

Creates a deep copy of the given XMLNamespaces_t structure.

Parameters:
nsthe XMLNamespaces_t structure to be copied
Returns:
a (deep) copy of the given XMLNamespaces_t structure.
LIBLAX_EXTERN XMLNamespaces_t* XMLNamespaces_create ( void  )

Creates a new empty XMLNamespaces_t structure.

LIBLAX_EXTERN void XMLNamespaces_free ( XMLNamespaces_t *  ns)

Frees the given XMLNamespaces_t structure.

Parameters:
nsXMLNamespaces structure to be freed.
LIBLAX_EXTERN int XMLNamespaces_getIndex ( const XMLNamespaces_t *  ns,
const char *  uri 
)

Lookup the index of an XML namespace declaration by URI.

Parameters:
uria string, uri of the required namespace.
Returns:
the index of the given declaration, or -1 if not present.
LIBLAX_EXTERN int XMLNamespaces_getIndexByPrefix ( const XMLNamespaces_t *  ns,
const char *  prefix 
)

Look up the index of an XML namespace declaration by Prefix.

Parameters:
prefixa string, prefix of the required namespace.
Returns:
the index of the given declaration, or -1 if not present.
LIBLAX_EXTERN int XMLNamespaces_getLength ( const XMLNamespaces_t *  ns)
LIBLAX_EXTERN int XMLNamespaces_getNumNamespaces ( const XMLNamespaces_t *  ns)
LIBLAX_EXTERN char* XMLNamespaces_getPrefix ( const XMLNamespaces_t *  ns,
int  index 
)
LIBLAX_EXTERN char* XMLNamespaces_getPrefixByURI ( const XMLNamespaces_t *  ns,
const char *  uri 
)
LIBLAX_EXTERN char* XMLNamespaces_getURI ( const XMLNamespaces_t *  ns,
int  index 
)
LIBLAX_EXTERN char* XMLNamespaces_getURIByPrefix ( const XMLNamespaces_t *  ns,
const char *  prefix 
)
LIBLAX_EXTERN int XMLNamespaces_hasNS ( const XMLNamespaces_t *  ns,
const char *  uri,
const char *  prefix 
)

Predicate returning true or false depending on whether an XML Namespace with the given URI is contained in this XMLNamespaces list.

Returns:
true if an XML Namespace with the given uri/prefix pair is contained in this XMLNamespaces list, false otherwise.
LIBLAX_EXTERN int XMLNamespaces_hasPrefix ( const XMLNamespaces_t *  ns,
const char *  prefix 
)

Predicate returning true or false depending on whether an XML Namespace the given Prefix is contained in this XMLNamespaces list.

Returns:
true if an XML Namespace with the given URI is contained in this XMLNamespaces list, false otherwise.
LIBLAX_EXTERN int XMLNamespaces_hasURI ( const XMLNamespaces_t *  ns,
const char *  uri 
)

Predicate returning true or false depending on whether an XML Namespace with the given URI is contained in this XMLNamespaces list.

Returns:
true if an XML Namespace with the given URI is contained in this XMLNamespaces list, false otherwise.
LIBLAX_EXTERN int XMLNamespaces_isEmpty ( const XMLNamespaces_t *  ns)

Predicate returning true or false depending on whether this XMLNamespaces list is empty.

Returns:
true if this XMLNamespaces list is empty, false otherwise.
LIBLAX_EXTERN int XMLNamespaces_remove ( XMLNamespaces_t *  ns,
int  index 
)

Removes an XML Namespace stored in the given position of this list.

Parameters:
indexan integer, position of the removed 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_INDEX_EXCEEDS_SIZE
  • LIBSBML_INVALID_OBJECT
LIBLAX_EXTERN int XMLNamespaces_removeByPrefix ( XMLNamespaces_t *  ns,
const char *  prefix 
)

Removes an XML Namespace with the given Prefix.

Parameters:
prefixa string, prefix of the required 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_INDEX_EXCEEDS_SIZE
  • LIBSBML_INVALID_OBJECT
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines