Examples of nsIDOMNode


Examples of org.mozilla.interfaces.nsIDOMNode

      }
    }
    String text = builder.toString().trim();
    if(text.length() > 0) return text;

    nsIDOMNode node = element.getFirstChild();
    while(node != null) {
      builder.append(node.getNodeValue());
      node = node.getNextSibling();
    }
    return builder.toString();
  }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

      }
      builder.append('<').append(node.getNodeName());
      nsIDOMNamedNodeMap attributes = node.getAttributes();
      if(attributes != null)  {
        for(long i = 0; i < attributes.getLength(); i++) {
          nsIDOMNode attr = attributes.item(i);
          builder.append(' ').append(attr.getNodeName());
          builder.append('=').append('\"').append(attr.getNodeValue()).append('\"');
        }
      }
      builder.append('>');

      nsIDOMNodeList children = node.getChildNodes();
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

  }
 
  public static String getAttribute(nsIDOMNamedNodeMap map, String name) {
    if(map == null) return null;
    for(long i = 0; i < map.getLength(); i++) {
      nsIDOMNode node = map.item(i);
      if(!name.equalsIgnoreCase(node.getNodeName())) continue;
      String link  = node.getNodeValue();
      if(link == null
          || (link = link.trim()).isEmpty() || "#".equals(link)) continue;
      return link;
    }
    return null;
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

//        <a href="/p/forklabs-javaxpcom/" onclick="cancelBubble=true;">Project&nbsp;Home</a>
//      </div>
//    </div>
//  </th>
   protected String exploreTableCell(nsIDOMHTMLTableCellElement cell) {
      nsIDOMNode anchor = cell.getElementsByTagName("a").item(0L);
      String value = this.getTextFrom(anchor);
      return value;
      }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

      String value = this.getTextFrom(anchor);
      return value;
      }

   protected void exploreMainMenu() {
      nsIDOMNode node = this.getElementById("mt");
      nsIDOMHTMLTableElement table = asTable(node);

      System.out.println("=== Inspecting the table node ===");
      inspect(table);
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

   /**
    * Creates a selector on the document and its children.
    * @return   the selector.
    */
   public Selector selector() {
      nsIDOMNode document = this.getDocument();
      Selector selector = this.selector(document);
      return selector;
      }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

      boolean has_children = node.hasChildNodes();
      if (has_children) {
         nsIDOMNodeList child_nodes = node.getChildNodes();
         for (long l = 0, len = child_nodes.getLength(); l < len; l++) {
         // child will be added in the list of children
            nsIDOMNode child = child_nodes.item(l);
            List<nsIDOMNode> children = this.getAllChildren(child);
            list.addAll(children);
            }
         }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

    * @return   the first node that match the filters, or {@code null} if the
    *           selection is the empty set.
    */
   @SuppressWarnings("hiding")
   public nsIDOMNode get() {
      nsIDOMNode root = this.getRoot();
      List<nsIDOMNode> candidates = this.getAllChildren(root);

      List<UnaryPredicate<nsIDOMNode>> filters = this.getFilters();
      for (UnaryPredicate<nsIDOMNode> filter : filters) {
         Algorithm.removeIf(candidates, Predicates.not1(filter));
         }

      nsIDOMNode candidate = (0 != candidates.size()) ? candidates.get(0) : null;
      return candidate;
      }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

    * the filters.
    * @return   the list of nodes that match the filters.
    */
   @SuppressWarnings("hiding")
   public List<nsIDOMNode> list() {
      nsIDOMNode root = this.getRoot();
      List<nsIDOMNode> candidates = this.getAllChildren(root);

      List<UnaryPredicate<nsIDOMNode>> filters = this.getFilters();
      for (UnaryPredicate<nsIDOMNode> filter : filters) {
         Algorithm.removeIf(candidates, Predicates.not1(filter));
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNode

         sb.append(text);
         }

      nsIDOMNodeList children = node.getChildNodes();
      for (long i = 0, len = children.getLength(); i < len; i++) {
         nsIDOMNode child = children.item(i);
         String text = asPlainText(child);
         sb.append(text);
         }

      String text = sb.toString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.