"Price Spectre"
 All Data Structures Functions Pages
XMLNodeList Class Reference

Public Member Functions

 item ($index)
 
 count ()
 

Detailed Description

A class that represents a list of XMLNodes .

Member Function Documentation

count ( )

Retrieves number of top-level nodes in the XMLNodeList.

Returns
A count of the number of top-level nodes.
var response = new XMLDocument(ws.post());
var errors = response.getElements('errors');
var countErrors = errors.count();
if(countErrors > 0)
{
throw countErrors + " errors.";
}
item (   $index)

Retrieves number of top-level nodes in the XMLNodeList.

Returns
The node in the list at the specified index. NULL if index is out of bounds.
Parameters
indexSpecifies the index of a node in the XMLNodeList to retrieve.
var response = new XMLDocument(ws.post());
var prices = response.getElements('currentPrice');
var price = prices.item(0);
if(price !== null)
{
ps.setPrice(price.getValue() - 0.01);
}
else
{
throw "No prices found.";
}