DOCUMENTS 5 - PortalScripting API
Public Member Functions | Public Attributes | List of all members
DOMNamedNodeMap Class Reference

A DOMNamedNodeMap is a kind of index for a set of DOMNodes, in which each node has got a unique name. More...

Public Member Functions

DOMNode getNamedItem (String name)
 Get a node from the map by its unique name. More...
 
DOMNode item (Integer index)
 Get the a node from the map at a certain position. More...
 
DOMNode removeNamedItem (String name)
 Remove a node from the map. More...
 
DOMNode setNamedItem (DOMNode arg)
 Add a node to the map or replace an existing one. More...
 

Public Attributes

Integer length
 The number of nodes in the map. More...
 

Detailed Description

A DOMNamedNodeMap is a kind of index for a set of DOMNodes, in which each node has got a unique name.

The attributes of a DOMElement are organized in a DOMNamedNodeMap. See DOMElement.attributes. The attached nodes can be accessed either by the name or by an integer index. When using an index, the output order of the nodes is not determined. Objects of this class cannot be created directly.

Remarks about W3C conformity
The class covers the NamedNodeMap interface of DOM level 1. The underlying native library already supports at least level 2.

Since
DOCUMENTS 4.0c

Member Function Documentation

◆ getNamedItem()

DOMNode DOMNamedNodeMap::getNamedItem ( String  name)

Get a node from the map by its unique name.

Parameters
nameThe name.
Returns
The node, respectively null, if no node with the name is in the map.
Since
DOCUMENTS 4.0c

◆ item()

DOMNode DOMNamedNodeMap::item ( Integer  index)

Get the a node from the map at a certain position.

This is useful only to iterate over all nodes in the map.

Parameters
indexthe zero based index of the element.
Returns
The requested DOMNode Object. If the index is invalid, the method returns null.
Remarks
It is also possible to access the nodes using square brackets, as if the object would be an array.
Since
DOCUMENTS 4.0c

◆ removeNamedItem()

DOMNode DOMNamedNodeMap::removeNamedItem ( String  name)

Remove a node from the map.

Parameters
nameThe unique node name.
Returns
The removed node.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

◆ setNamedItem()

DOMNode DOMNamedNodeMap::setNamedItem ( DOMNode  arg)

Add a node to the map or replace an existing one.

Parameters
argThe node to add. The name for indexing is the value of the attribute DOMNode.nodeName,
Returns
If a node with the same name has already been added, the method removes that node and returns it. Otherwise it returns null.
Exceptions
DOMException
Since
DOCUMENTS 4.0c

Member Data Documentation

◆ length

Integer DOMNamedNodeMap::length

The number of nodes in the map.

This property is readonly.

Since
DOCUMENTS 4.0c

This documentation refers DOCUMENTS 5.0e (2105).
Created at 11-09-2019. - © 1998-2019 otris software AG, Königswall 21, D-44137 Dortmund. support@otris.de