B2G/gecko/testing/marionette/marionette-elements.js
/**
   * Find values by XPATH
   * 
   * @param nsIDOMElement root
   *        Document root
   * @param string value
   *        XPATH search string
   * @param nsIDOMElement node
   *        start node
   *
   * @return object
   *        returns a list of found nsIDOMElements
   */
Find values by XPATH

@param nsIDOMElement root
Document root
@param string value
XPATH search string
@param nsIDOMElement node
start node

@return object
returns a list of found nsIDOMElements
Find values by XPATH @param nsIDOMElement root Document root @param string value XPATH search string @param nsIDOMElement node start node @return object returns a list of found nsIDOMElements
function EM_findByXPathAll(root, value, node) {
    let values = root.evaluate(value, node, null,
                      Components.interfaces.nsIDOMXPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
    let elements = [];
    let element = values.iterateNext();
    while (element) {
      elements.push(element);
      element = values.iterateNext();
    }
    return elements;
  }
function EM_findByXPathAll ( root , value , node ) { let values = root . evaluate ( value , node , null , Components . interfaces . nsIDOMXPathResult . ORDERED_NODE_ITERATOR_TYPE , null ) ; let elements = [ ] ; let element = values . iterateNext ( ) ; while ( element ) { elements . push ( element ) ; element = values . iterateNext ( ) ; } return elements ; }
Find values by XPATH
Find values by XPATH