Class xrx.xpath.NodeSet
Defined in: nodeset.js.
Constructor Attributes | Constructor Name and Description |
---|---|
A set of nodes sorted by their prefix order in the document.
|
Method Attributes | Method Name and Description |
---|---|
add(node)
Adds a node to this node-set.
|
|
getFirst()
Returns the first node of the node-set.
|
|
Return the length of this node-set.
|
|
iterator(opt_reverse)
Returns an iterator over this nodeset.
|
|
<static> |
xrx.xpath.NodeSet.merge(a, b)
Merges two node-sets, removing duplicates.
|
number()
Returns the number representation of this node-set.
|
|
string()
Returns the string representation of this node-set.
|
|
unshift(node)
Prepends a node to this node-set.
|
Method Detail
add(node)
Adds a node to this node-set.
- Parameters:
- {!xrx.node} node
- The node to be added.
{?xrx.node}
getFirst()
Returns the first node of the node-set.
- Returns:
- {?xrx.node} The first node of the nodeset if the nodeset is non-empty; otherwise null.
{number}
getLength()
Return the length of this node-set.
- Returns:
- {number} The length of the node-set.
{!xrx.xpath.NodeSet.Iterator}
iterator(opt_reverse)
Returns an iterator over this nodeset. Once this iterator is made, DO NOT
add to this nodeset until the iterator is done.
- Parameters:
- {boolean=} opt_reverse
- Whether to iterate right to left or vice versa.
- Returns:
- {!xrx.xpath.NodeSet.Iterator} An iterator over the nodes.
<static>
{!xrx.xpath.NodeSet}
xrx.xpath.NodeSet.merge(a, b)
Merges two node-sets, removing duplicates. This function may modify both
node-sets, and will return a reference to one of the two.
Note: We assume that the two node-sets are already sorted in DOM order.
- Parameters:
- {!xrx.xpath.NodeSet} a
- The first node-set.
- {!xrx.xpath.NodeSet} b
- The second node-set.
- Returns:
- {!xrx.xpath.NodeSet} The merged node-set.
{number}
number()
Returns the number representation of this node-set.
- Returns:
- {number} The number representation of this node-set.
{string}
string()
Returns the string representation of this node-set.
- Returns:
- {string} The string representation of this node-set.
unshift(node)
Prepends a node to this node-set.
- Parameters:
- {!xrx.node} node
- The node to be added.