Main Page Modules Namespace List Data Structures File List Data Fields Examples

# Element
[Node]

## Defines

#define | DOM_ELEMENT DOM_NODE

## Functions

DOM_ELEMENT * | domElementNew (const char *name)
void | domElementDestroy (DOM_ELEMENT *element)
void | domElementSetAttribute (DOM_ELEMENT *element, const char *name, const char *value)
void | domElementSetAttributeVariant (DOM_ELEMENT *element, const char *name, enum VariantType type, void *value, unsigned long valueSize)
const char * | domElementGetAttribute (DOM_ELEMENT *element, const char *name)
void * | domElementGetAttributeVariant (DOM_ELEMENT *element, const char *name, enum VariantType type)
void | domElementUnsetAttribute (DOM_ELEMENT *element, const char *name)
const char * | domElementEnumAttributes (DOM_ELEMENT *element, unsigned long index)

## Detailed Description

Element node manipulation.

## Define Documentation

#define DOM_ELEMENT DOM_NODE

| Defines a DOM_ELEMENT as a DOM_NODE. This gives us "inheritance" in C.

## Function Documentation

void domElementDestroy | ( | DOM_ELEMENT * | element | ) |

Recursively destroys a DOM element.

Parameters:

  element | [in] The element to be destroyed.

const char* domElementEnumAttributes | ( | DOM_ELEMENT * | element,
|  | unsigned long | index
| ) |

Enumerate the attributes on a given element.

Parameters:

  element | [in] The element to enumerate the attributes of.
  index | [in] The index into the enumeration.

Returns:
  If a valid attribute is found at the given index, the name of the attribute is returned. Otherwise, NULL is returned.

const char* domElementGetAttribute | ( | DOM_ELEMENT * | element,
|  | const char * | name
| ) |

Get the value associated with an attribute by its name.

Parameters:

  element | [in] The element node to set the attribute on.
  name | [in] The name of the attribute.

Returns:
  On success, a valid pointer is return that is the value associated with the attribute 'name'. Otherwise, NULL is returned.

void* domElementGetAttributeVariant | ( | DOM_ELEMENT * | element,
|  | const char * | name,
|  | enum VariantType | type
| ) |

Returns the variant value associated with a given attribute.

Variant type manipulation (For information on variant manipulation)

Parameters:

  element | [in] The node to get the value of.
  name | [in] The name of the attribute.
  type | [in] The type used to interpret the value.

Returns:
  The return value is dependant upon the type argument.

Examples:
  variant.c.

DOM_ELEMENT* domElementNew | ( | const char * | name | ) |

Constructs a DOM element with the given name.

Parameters:

  name | [in] The name of the element to construct.

Returns:
  The initialize DOM element node.

Examples:
  variant.c.

void domElementSetAttribute | ( | DOM_ELEMENT * | element,
|  | const char * | name,
|  | const char * | value
| ) |

Sets an attribute on an element by its name.

Parameters:

  element | [in] The element node to set the attribute on.
  name | [in] The name of the attribute.
  value | [in] The value of the attribute.

void domElementSetAttributeVariant | ( | DOM_ELEMENT * | element,
|  | const char * | name,
|  | enum VariantType | type,
|  | void * | value,
|  | unsigned long | valueSize
| ) |

Sets an attribute on an element by its name.

Variant type manipulation (For information on variant manipulation)

Parameters:

  element | [in] The element node to set the attribute on.
  name | [in] The name of the attribute.
  type | [in] The type used to interpret the value parameter.
  value | [in] A pointer to the raw value data.
  valueSize | [in] The size, in bytes, of the value buffer.

Examples:
  variant.c.

void domElementUnsetAttribute | ( | DOM_ELEMENT * | element,
|  | const char * | name
| ) |

Unsets an attribute on an element by its name.

Parameters:

  element | [in] The element node to unset the attribute on.
  name | [in] The name of the attribute.