::class xmlNodeList public

CLASS: xmlNodeList

The xmlNodeList interface provides the abstraction of an ordered collection of xmlNodes, without defining or
constraining how this collection is implemented. xmlNodeList objects in the DOM are live.

For this ooRexx implementation a xmlNodeLIst is defined as a resticted array, whose members must be an instance of
xmLNode.

The items in the xmlNodeList are accessible via an integral index, starting from 0.

Definition at line 207 of xmlDOM.cls

Public Methods

  append (node)
  fromOorexxArray (nodeArray)
  init (nodeList=(.array~new))
node - The xmlNode at the index in the xmlNodeList, or .nil if not a valid index. item (index)
count - The number of items (xmlNodes) in the xmlNodeList. length ()
array - A native ooRexx array representing the xmlNodeList. toOorexxArray ()

Public Attributes

  nodeList
  nodeList
no comment

Private Methods

node - The removed xmlNode or .nil, if not present. remove (node)

Instantiated by

xmlDOM.cls line 481
xmlDOM.cls line 633
xmlDOM.cls line 1378
xmlDOM.cls line 1406
xmlDOM.cls line 1763
xmlDOM.cls line 2425

Feature Detail

xmlNodeList::method length

Provide the number of xmlNodes in the xmlNodeList.

Returns
count - The number of items (xmlNodes) in the xmlNodeList.

Definition at line 212 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) "

xmlNodeList::attribute nodeList get

The nodeList array can only be set by the xmlNodeList self

Definition at line 217 of xmlDOM.cls
Dynamically referenced by
xmlDOM.cls line 213 "return self~nodeList~items"
xmlDOM.cls line 230 "self~nodeList = nodeList"
xmlDOM.cls line 241 "node = self~nodeList[index+1]"
xmlDOM.cls line 253 "self~nodeList~append(node)"
xmlDOM.cls line 264 "node = self~nodelist~remove(node)"
xmlDOM.cls line 270 "return self~nodeList"
xmlDOM.cls line 281 "self~nodeList = nodeArray"

xmlNodeList::attribute nodeList set
Definition at line 218 of xmlDOM.cls

xmlNodeList::method init

xmlNodeList instance constructor.

As the creation of the xmlNodeList is left to the implementer, for ooRexx the constructor expects to get the
representation of the complete xmlNodeList as an ooRexx array.

Parameters
nodeList=(.array~new) - an ooRexx array of xmlNodes.

Definition at line 226 of xmlDOM.cls

xmlNodeList::method item

Retrieve the xmlNode at index position.

Parameters
index - The index (base 0) of the wanted Node.
Returns
node - The xmlNode at the index in the xmlNodeList, or .nil if not a valid index.

Definition at line 237 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"

xmlNodeList::method append

Add a xmlNode to the xmlNodeList.


Parameters
node - The xmlNode to be added to the xmlNodeList.
Raises
user domException - HIERARCHY_REQUEST_ERR

Definition at line 249 of xmlDOM.cls
Dynamically referenced by
tryxmldom.rex line 61 "legData~polyLines~append(polyLine)"
tryxmldom.rex line 63 "legData~directions~append(stepDirections~item(s)~firstChild~nodeValue)"
tryxmldom.rex line 67 "legData~routePoints~append(lat lon)"
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)"
xmlDOM.cls line 253 "self~nodeList~append(node)"
xmlDOM.cls line 505 "self~childNodes~append(child)"
xmlDOM.cls line 629 "self~childNodes~append(child)"
xmlDOM.cls line 635 "newList~append(child)"
xmlDOM.cls line 636 "newList~append(self~childNodes~item(i))"
xmlDOM.cls line 877 "nl~append(nodes~item(n))"
xmlDOM.cls line 880 "nl~append(nodes~item(n))"
xmlDOM.cls line 1401 "siblings~append(child)"
xmlDOM.cls line 1403 "siblings~append(text)"
xmlDOM.cls line 1595 "nodeList~append(node)"
xmlDOM.cls line 1598 "nodeList~append(node)"
xmlDOM.cls line 1621 "nodeList~append(node)"
xmlDOM.cls line 1624 "nodeList~append(node)"
xmlDOM.cls line 1633 "nodeList~append(node)"
xmlDOM.cls line 1636 "nodeList~append(node)"
xmlDOM.cls line 2440 "nodelist~append(node)"
xmlDOM.cls line 2443 "nodelist~append(node)"

xmlNodeList::method remove private protected

Removes a xmlNode from the xmlNodeList.

Note: On hold for possible future use

Parameters
node - The xmlNode to be removed.
Returns
node - The removed xmlNode or .nil, if not present.

Definition at line 262 of xmlDOM.cls

xmlNodeList::method toOorexxArray


Returns
array - A native ooRexx array representing the xmlNodeList.

Definition at line 269 of xmlDOM.cls

xmlNodeList::method fromOorexxArray

Sets the xmlNodeList from a native ooRexx array.

Parameters
nodeArray - the native ooRexx array to replace an existing xmlNodeList.

Definition at line 275 of xmlDOM.cls

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