::class xmlNamedNodeMap public

CLASS: xmlNamedNodeMap

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

Definition at line 897 of xmlDOM.cls

Public Methods

  fromOorexxDirectory (nodeDirectory)
node - The xmlNode with the specified name, or .nil. getNamedItem (name)
node - A xmlNode(of any type) with the specified local name and namespace URI, or null. getNamedItemNS (namespaceURI, localName)
  init ()
node - The node at the indexth position in the map, or .nil if not a valid index. item (index)
- The number of nodes in the xmlNamedNodeMap. length ()
node - The node removed from this map if a node with such a name exists. removeNamedItem (name)
node - The node removed from this map if a node with such a name exists. removeNamedItemNS (namespaceURI=.nil, localName)
node - The replaced xmlNode or .nil if no replacement. setNamedItem (arg)
node - The replaced xmlNode or .nil if no replacement. setNamedItemNS (arg)
directory - A native ooRexx directory representing the NamedNodeMap. toOorexxDirectory ()

Private Attributes

  namedMap

Instantiated by

xmlDOM.cls line 1667

Feature Detail

xmlNamedNodeMap::attribute namedMap private

A private array with directory entries, that have a (possibly qualified) name as index and xmlNodes as items.

Definition at line 901 of xmlDOM.cls
Dynamically referenced by
xmlDOM.cls line 906 "self~namedMap = .directory~new"
xmlDOM.cls line 914 "return self~namedMap~items"
xmlDOM.cls line 924 "node = self~namedMap[name]"
xmlDOM.cls line 940 "node = self~namedMap[localName]"
xmlDOM.cls line 956 "node = self~namedMap~allItems[index+1]"
xmlDOM.cls line 976 "node = self~namedMap~remove(name)"
xmlDOM.cls line 999 "node = self~namedMap~remove(localName)"
xmlDOM.cls line 1022 "node = self~namedMap[name]"
xmlDOM.cls line 1023 "self~namedMap[name] = arg"
xmlDOM.cls line 1045 "node = self~namedMap[name]"
xmlDOM.cls line 1050 "else self~namedMap[name] = arg"
xmlDOM.cls line 1058 "return self~namedMap"
xmlDOM.cls line 1073 "self~namedMap = nodeDirectory"

xmlNamedNodeMap::method init

xmlNamedNodeMap instance constructor.


Definition at line 905 of xmlDOM.cls

xmlNamedNodeMap::method length

The number of xmlNodes in this map.

Returns
- The number of nodes in the xmlNamedNodeMap.

Definition at line 913 of xmlDOM.cls
Dynamically referenced by
tryxmldom.rex line 36 "do l=0 to legs~length-1"
tryxmldom.rex line 56 "do s=0 to steps~length-1"
tryxmldom.rex line 98 "do i=0 to copyrights~length-1"
tryxmldom.rex line 101 "text = text~substr(1,text~length-2)"
tryxmldom.rex line 121 "do i=0 to warnings~length-1"
tryxmldom.rex line 124 "if text~length>0 "
tryxmldom.rex line 124 "text = text~substr(1,text~length-2)"
tryxmldom.rex line 245 "do n=0 to nodes~length-1"
tryxmldom.rex line 252 "if node~attributes~length>0 "
tryxmldom.rex line 264 "if attributes~length>0 "
tryxmldom.rex line 265 "if node~childNodes~length>0 "
xmlDOM.cls line 570 "if (self~childNodes~length>0) "
xmlDOM.cls line 634 "do i=0 to self~childNodes~length-1"
xmlDOM.cls line 875 "do n=0 to nodes~length-1"
xmlDOM.cls line 882 "if nodes~item(n)~childNodes~length>0 "
xmlDOM.cls line 1207 "return self~data~length"
xmlDOM.cls line 1245 "if offset>self~data~length | count<0"
xmlDOM.cls line 1260 "if offset<0 | offset>self~data~length | count<0"
xmlDOM.cls line 1273 "if offset<0 | offset>self~data~length | count<0"
xmlDOM.cls line 1334 "do s=0 to siblings~length-1"
xmlDOM.cls line 1393 "if offset+1>self~data~length "
xmlDOM.cls line 1394 "raise user domException additional (.domException~index_size_err) description ("Offset" offset "is larger than length" self~data~length "of text")"
xmlDOM.cls line 1591 "do n=0 to nodes~length-1"
xmlDOM.cls line 1600 "if node~childNodes~length>0 "
xmlDOM.cls line 2436 "do n=0 to nodes~length-1"
xmlDOM.cls line 2445 "if (node~childNodes~length>0) "

xmlNamedNodeMap::method getNamedItem

Retrieves a node specified by name.

Parameters
name - The nodeName of a node to retrieve.
Returns
node - The xmlNode with the specified name, or .nil.

Definition at line 920 of xmlDOM.cls
Dynamically referenced by
xmlDOM.cls line 1682 "node = self~attributes~getNamedItem(name)"
xmlDOM.cls line 1701 "node = self~attributes~getNamedItem(localName)"
xmlDOM.cls line 1709 "node = self~attributes~getNamedItem(prefix":"localName)"
xmlDOM.cls line 1726 "attrNode = self~attributes~getNamedItem(name)"
xmlDOM.cls line 1744 "attrNode = self~attributes~getNamedItem(localName)"
xmlDOM.cls line 1751 "attrNode = self~attributes~getNamedItem(prefix":"localName)"
xmlDOM.cls line 1774 "return self~attributes~getNamedItem(name)<>.nil"
xmlDOM.cls line 1793 "boolean = self~attributes~getNamedItem(name)<>.nil"
xmlDOM.cls line 1799 "boolean = self~attributes~getNamedItem(prefix':'localName)<>.nil"
xmlDOM.cls line 1871 "node = self~attributes~getNamedItem(name)"
xmlDOM.cls line 1983 "node = self~attributes~getNamedItem(name)"

xmlNamedNodeMap::method getNamedItemNS

Retrieves a node specified by local name and namespace URI.

Per [XML Namespaces], applications must use the value .nil, as the namespaceURI parameter for methods if they
wish to have no namespace.

Parameters
namespaceURI - The namespace URI of the node to retrieve.
localName - The local name of the node to retrieve.
Returns
node - A xmlNode(of any type) with the specified local name and namespace URI, or null.

Definition at line 936 of xmlDOM.cls
Dynamically referenced by
xmlDOM.cls line 1918 "node = self~attributes~getNamedItemNS(namespaceURI,localName)"
xmlDOM.cls line 2002 "node = self~attributes~getNamedItemNS(namespaceURI, localName)"

xmlNamedNodeMap::method item

Returns the indexth item in the map. If index is greater than or equal to the number of nodes in this map, this
returns .nil.

Parameters
index - Index into this map.
Returns
node - The node at the indexth position in the map, or .nil if not a valid index.

Definition at line 952 of xmlDOM.cls
Dynamically referenced by
tryxmldom.rex line 21 "travel_mode = doc~getElementsByTagName("travel_mode")~item(0)~firstChild~nodeValue"
tryxmldom.rex line 26 "startAddress = doc~getElementsByTagName("start_address")~item(0)~firstChild~nodeValue"
tryxmldom.rex line 27 "endAddress = doc~getElementsByTagName("end_address")~item(0)~firstChild~nodeValue"
tryxmldom.rex line 29 "bounds = doc~getElementsByTagName("bounds")~item(0)"
tryxmldom.rex line 30 "maxlat = bounds~getElementsByTagName("northeast")~item(0)~childNodes~item(0)~firstChild~nodeValue"
tryxmldom.rex line 30 "maxlat = bounds~getElementsByTagName("northeast")~item(0)~childNodes~item(0)~firstChild~nodeValue"
tryxmldom.rex line 31 "maxlon = bounds~getElementsByTagName("northeast")~item(0)~childNodes~item(1)~firstChild~nodeValue"
tryxmldom.rex line 31 "maxlon = bounds~getElementsByTagName("northeast")~item(0)~childNodes~item(1)~firstChild~nodeValue"
tryxmldom.rex line 32 "minlat = bounds~getElementsByTagName("southwest")~item(0)~childNodes~item(0)~firstChild~nodeValue"
tryxmldom.rex line 32 "minlat = bounds~getElementsByTagName("southwest")~item(0)~childNodes~item(0)~firstChild~nodeValue"
tryxmldom.rex line 33 "minlon = bounds~getElementsByTagName("southwest")~item(0)~childNodes~item(1)~firstChild~nodeValue"
tryxmldom.rex line 33 "minlon = bounds~getElementsByTagName("southwest")~item(0)~childNodes~item(1)~firstChild~nodeValue"
tryxmldom.rex line 35 "legs = doc~getElementsByTagName("route")~item(0)~getElementsByTagName("leg")"
tryxmldom.rex line 37 "leg = legs~item(l)"
tryxmldom.rex line 58 "encPoly = encodedPolylines~item(s)~firstChild~firstChild~nodeValue"
tryxmldom.rex line 63 "legData~directions~append(stepDirections~item(s)~firstChild~nodeValue)"
tryxmldom.rex line 65 "lat = stepStartLocations~item(s)~childNodes~item(0)~firstChild~nodeValue"
tryxmldom.rex line 65 "lat = stepStartLocations~item(s)~childNodes~item(0)~firstChild~nodeValue"
tryxmldom.rex line 66 "lon = stepStartLocations~item(s)~childNodes~item(1)~firstChild~nodeValue"
tryxmldom.rex line 66 "lon = stepStartLocations~item(s)~childNodes~item(1)~firstChild~nodeValue"
tryxmldom.rex line 69 "legData~distances~append(stepDistances~item(s)~childNodes~item(1)~firstChild~nodeValue)"
tryxmldom.rex line 69 "legData~distances~append(stepDistances~item(s)~childNodes~item(1)~firstChild~nodeValue)"
tryxmldom.rex line 70 "legData~durations~append(stepDurations~item(s)~childNodes~item(0)~firstChild~nodeValue)"
tryxmldom.rex line 70 "legData~durations~append(stepDurations~item(s)~childNodes~item(0)~firstChild~nodeValue)"
tryxmldom.rex line 78 "gpx = out~childNodes~item(1)"
tryxmldom.rex line 99 "text ||= copyrights~item(i)~firstChild~nodeValue || .endofline"
tryxmldom.rex line 122 "text ||= warnings~item(i)~firstChild~nodeValue || .endofline"
tryxmldom.rex line 132 "metadata~insertBefore(name,metadata~childNodes~item(0))"
tryxmldom.rex line 246 "node = nodes~item(n)"
xmlDOM.cls line 570 "child = self~Childnodes~item(0)"
xmlDOM.cls line 635 "if self~childNodes~item(i) == where "
xmlDOM.cls line 636 "newList~append(self~childNodes~item(i))"
xmlDOM.cls line 877 "if nodes~item(n)~nodeName==name "
xmlDOM.cls line 877 "nl~append(nodes~item(n))"
xmlDOM.cls line 880 "nl~append(nodes~item(n))"
xmlDOM.cls line 882 "if nodes~item(n)~childNodes~length>0 "
xmlDOM.cls line 883 "self~treewalk(nodes~item(n)~childNodes, name, nl)"
xmlDOM.cls line 1068 "if \s~item~isA(.xmlNode) "
xmlDOM.cls line 1400 "child = self~parentNode~childNodes~item(c)"
xmlDOM.cls line 1592 "node = nodes~item(n)"
xmlDOM.cls line 2437 "node = nodes~item(n)"
xmlDOM.cls line 2905 "xml ||= s~item || .endofline"

xmlNamedNodeMap::method removeNamedItem

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.

This ooRexx implementation does not process a DTD, thus has no way to determine if a default value has to be provided.
The node is only removed, no additional checks for default value are made.

Parameters
name - The nodeName of the node to remove.
Returns
node - The node removed from this map if a node with such a name exists.
Raises
user domException - NOT_FOUND_ERR

Definition at line 972 of xmlDOM.cls
Dynamically referenced by
xmlDOM.cls line 1817 "removed = self~attributes~removeNamedItem(name)"
xmlDOM.cls line 1851 "removed = self~attributes~removeNamedItem(oldAttr~nodeName)"

xmlNamedNodeMap::method removeNamedItemNS

Removes a node specified by local name and namespace URI. A removed attribute may be known to have a default value
when this map contains the attributes attached to an element, as returned by the attributes attribute of the xmlNode
interface. If so, an attribute immediately appears containing the default value as well as the corresponding
namespace URI, local name, and prefix when applicable.

Per [XML Namespaces], applications must use the value .nil as the namespaceURI parameter for methods if they
wish to have no namespace.

Parameters
namespaceURI=.nil - The namespace URI of the node to remove.
localName - The local name of the node to remove.
Returns
node - The node removed from this map if a node with such a name exists.
Raises
user domException - NOT_FOUND_ERR
See Also:
#removeNamedItem for behaviour concerning default values.

Definition at line 994 of xmlDOM.cls
Dynamically referenced by
xmlDOM.cls line 1836 "removed = self~attributes~removeNamedItemNS(namespaceURI,localName)"

xmlNamedNodeMap::method setNamedItem

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

Parameters
arg - A xmlNode to store in this map, accessible using its nodeName attribute.
Returns
node - The replaced xmlNode or .nil if no replacement.
Raises
user domException - WRONG_DOCUMENT_ERR
user domException - INUSE_ATTRIBUTE_ERR

Definition at line 1011 of xmlDOM.cls
Dynamically referenced by
xmlDOM.cls line 1879 "self~attributes~setNamedItem(node)"
xmlDOM.cls line 1951 "node = self~attributes~setNamedItem(newAttr)"

xmlNamedNodeMap::method setNamedItemNS

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. Replacing a node by itself has no effect.

Parameters
arg - A node to add to the map, subsequently accessible via namespaceURI and localName.
Returns
node - The replaced xmlNode or .nil if no replacement.
Raises
user domException - WRONG_DOCUMENT_ERR
user domException - INUSE_ATTRIBUTE_ERR

Definition at line 1034 of xmlDOM.cls
Dynamically referenced by
xmlDOM.cls line 1929 "self~attributes~setNamedItemNS(node)"
xmlDOM.cls line 1967 "node = self~attributes~setNamedItemNS(newAttr)"

xmlNamedNodeMap::method toOorexxDirectory

Provides a xmlNamedNodeMap as a native ooRexx directory

Returns
directory - A native ooRexx directory representing the NamedNodeMap.

Definition at line 1057 of xmlDOM.cls
Dynamically referenced by
tryxmldom.rex line 253 "attrDir = node~attributes~toOorexxDirectory"

xmlNamedNodeMap::method fromOorexxDirectory

Sets a NamedNodeMap from a native ooRexx directory

Parameters
nodeDirectory - The native ooRexx directory to replace an existing xmlNamedNodeMap.
Raises
syntax 93.914 - Named item is not a proper xmlNode

Definition at line 1064 of xmlDOM.cls

Get RexxLiterate at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated on 30 Jul 2015 13:56:50 for xmlDOM for OOrexx by rexxliterate  0.0.1