Gdome2 Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# GdomeNamedNodeMap

## Name

GdomeNamedNodeMap -- Interface NamedNodeMap implementation.

## Synopsis

    struct      GdomeNamedNodeMap;
    void        gdome_nnm_ref                   (GdomeNamedNodeMap *self,
                                                 GdomeException *exc);
    void        gdome_nnm_unref                 (GdomeNamedNodeMap *self,
                                                 GdomeException *exc);
    gpointer    gdome_nnm_query_interface       (GdomeNamedNodeMap *self,
                                                 const char *interface,
                                                 GdomeException *exc);
    GdomeNode*  gdome_nnm_getNamedItem          (GdomeNamedNodeMap *self,
                                                 GdomeDOMString *name,
                                                 GdomeException *exc);
    GdomeNode*  gdome_nnm_setNamedItem          (GdomeNamedNodeMap *self,
                                                 GdomeNode *arg,
                                                 GdomeException *exc);
    GdomeNode*  gdome_nnm_removeNamedItem       (GdomeNamedNodeMap *self,
                                                 GdomeDOMString *name,
                                                 GdomeException *exc);
    GdomeNode*  gdome_nnm_item                  (GdomeNamedNodeMap *self,
                                                 gulong index,
                                                 GdomeException *exc);
    gulong      gdome_nnm_length                (GdomeNamedNodeMap *self,
                                                 GdomeException *exc);
    GdomeNode*  gdome_nnm_getNamedItemNS        (GdomeNamedNodeMap *self,
                                                 GdomeDOMString *namespaceURI,
                                                 GdomeDOMString *localName,
                                                 GdomeException *exc);
    GdomeNode*  gdome_nnm_setNamedItemNS        (GdomeNamedNodeMap *self,
                                                 GdomeNode *arg,
                                                 GdomeException *exc);
    GdomeNode*  gdome_nnm_removeNamedItemNS     (GdomeNamedNodeMap *self,
                                                 GdomeDOMString *namespaceURI,
                                                 GdomeDOMString *localName,
                                                 GdomeException *exc);

## Description

Objects implementing the GdomeNamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that GdomeNamedNodeMap does not inherit from GdomeNodeList; GdomeNamedNodeMap are not maintained in any particular order. Objects contained in an object implementing GdomeNamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a GdomeNamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.

GdomeNamedNodeMap objects in the DOM are live.

## Details

### struct GdomeNamedNodeMap

    struct GdomeNamedNodeMap {
    	gpointer user_data;
    };

### gdome_nnm_ref ()

    void        gdome_nnm_ref                   (GdomeNamedNodeMap *self,
                                                 GdomeException *exc);

Increase the reference count of the specified NamedNodeMap.

`self` : | NodeList Object ref
`exc` : | Exception Object ref

### gdome_nnm_unref ()

    void        gdome_nnm_unref                 (GdomeNamedNodeMap *self,
                                                 GdomeException *exc);

Decrease the reference count of the specified NamedNodeMap. Free the NamedNodeMap structure if the specified NamedNodeMap will have zero reference.

`self` : | NodeList Object ref
`exc` : | Exception Object ref

### gdome_nnm_query_interface ()

    gpointer    gdome_nnm_query_interface       (GdomeNamedNodeMap *self,
                                                 const char *interface,
                                                 GdomeException *exc);

`self` : | NamedNodeMap Object ref
`interface` : | interface needed
`exc` : | Exception Object ref
Returns : | a reference to this object that implements the `interface` needed, or `NULL` if the `interface` is not supported by this Object.

### gdome_nnm_getNamedItem ()

    GdomeNode*  gdome_nnm_getNamedItem          (GdomeNamedNodeMap *self,
                                                 GdomeDOMString *name,
                                                 GdomeException *exc);

Retrieves a node specified by name.

`self` : | NamedNodeMap Objects ref
`name` : | The nodeName of the node to retrieve.
`exc` : | Exception Object ref
Returns : | a Node (of any type) with the specified nodeName, or `NULL` if it does not identify any node in this map.

### gdome_nnm_setNamedItem ()

    GdomeNode*  gdome_nnm_setNamedItem          (GdomeNamedNodeMap *self,
                                                 GdomeNode *arg,
                                                 GdomeException *exc);

Adds a node using its nodeName attribute. If a node with that name is already present in this map, it is replaced by the new one.

`GDOME_WRONG_DOCUMENT_ERR`: Raised if `arg` was created from a different document than the one that created this map. `GDOME_NO_MODIFICATION_ALLOWED_ERR`: Raised if this map is readonly. `GDOME_INUSE_ATTRIBUTE_ERR`: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.

`self` : | NamedNodeMap Objects ref
`arg` : | a node to store in this map.
`exc` : | Exception Object ref
Returns : | if the new Node replaces an existing node, the replaced Node is returned, otherwise `NULL` is returned. `GDOME_HIERARCHY_REQUEST_ERR`: Raised if an attempt is made to add a node doesn't belong in this NamedNodeMap. Examples would include trying to insert something other than an Attr node into an Element's map of attributes, or a non-Entity node into the DocumentType's map of Entities.

### gdome_nnm_removeNamedItem ()

    GdomeNode*  gdome_nnm_removeNamedItem       (GdomeNamedNodeMap *self,
                                                 GdomeDOMString *name,
                                                 GdomeException *exc);

Removes a node specified by name. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.

`GDOME_NOT_FOUND_ERR`: Raised if there is no node named `name` in this map. `GDOME_NO_MODIFICATION_ALLOWED_ERR`: Raised if this map is readonly.

`self` : | NamedNodeMap Objects ref
`name` : | The nodeName of the node to remove.
`exc` : | Exception Object ref
Returns : | the node removed from this map if a node with such a name exists.

### gdome_nnm_item ()

    GdomeNode*  gdome_nnm_item                  (GdomeNamedNodeMap *self,
                                                 gulong index,
                                                 GdomeException *exc);

`self` : | NamedNodeMap Objects ref
`index` : | Index into this map.
`exc` : | Exception Object ref
Returns : | the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this returns `NULL`.

### gdome_nnm_length ()

    gulong      gdome_nnm_length                (GdomeNamedNodeMap *self,
                                                 GdomeException *exc);

`self` : | NamedNodeMap Objects ref
`exc` : | Exception Object ref
Returns : | the number of nodes in this map. The range of valid child node indices is 0 to length-1 inclusive.

### gdome_nnm_getNamedItemNS ()

    GdomeNode*  gdome_nnm_getNamedItemNS        (GdomeNamedNodeMap *self,
                                                 GdomeDOMString *namespaceURI,
                                                 GdomeDOMString *localName,
                                                 GdomeException *exc);

Retrieves a node specified by local name and namespace URI.

`self` : | NamedNodeMap Objects ref
`namespaceURI` : | The namespace URI of the node to retrieve.
`localName` : | The local name of the node to retrieve.
`exc` : | Exception Object ref
Returns : | a Node (of any type) with the specified local name and namespace URI, or `NULL` if they do not identify any node in this map.

### gdome_nnm_setNamedItemNS ()

    GdomeNode*  gdome_nnm_setNamedItemNS        (GdomeNamedNodeMap *self,
                                                 GdomeNode *arg,
                                                 GdomeException *exc);

Adds a node using its namespaceURI and localName. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one

`GDOME_WRONG_DOCUMENT_ERR`: Raised if `arg` was created from a different document than the one that created this map. `GDOME_NO_MODIFICATION_ALLOWED_ERR`: Raised if this map is readonly. `GDOME_INUSE_ATTRIBUTE_ERR`: Raised if `arg` is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.

`self` : | NamedNodeMap Objects ref
`arg` : | a node to store in this map. The node will later be accessible using the value of its namespaceURI and localName attributes.
`exc` : | Exception Object ref
Returns : | If the new Node replaces an existing node the replaced Node is returned, otherwise null is returned. `GDOME_HIERARCHY_REQUEST_ERR`: Raised if an attempt is made to add a node doesn't belong in this NamedNodeMap. Examples would include trying to insert something other than an Attr node into an Element's map of attributes, or a non-Entity node into the DocumentType's map of Entities.

### gdome_nnm_removeNamedItemNS ()

    GdomeNode*  gdome_nnm_removeNamedItemNS     (GdomeNamedNodeMap *self,
                                                 GdomeDOMString *namespaceURI,
                                                 GdomeDOMString *localName,
                                                 GdomeException *exc);

Removes a node specified by local name and namespace URI. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.

`GDOME_NOT_FOUND_ERR`: Raised if there is no node named `name` in this map. `GDOME_NO_MODIFICATION_ALLOWED_ERR`: Raised if this map is readonly.

`self` : | NamedNodeMap Objects ref
`namespaceURI` : | The namespace URI of the node to remove.
`localName` : | The local name of the node to remove.
`exc` : | Exception Object ref
Returns : | the node removed from this map if a node with such a local name and namespace URI exists.

<<< Previous Page | Home | Up | Next Page >>>
GdomeNodeList | GdomeCharacterData