Package org.w3c.dom.html2

Examples of org.w3c.dom.html2.HTMLHeadElement


    if(action == null)
      return null;

    final WebForm form = new WebForm(action, getFormMethod(formElement.getMethod()), getEncodingType(formElement.getEnctype()));

    final HTMLCollection formFields = formElement.getElements();
    for(int i = 0; i < formFields.getLength(); i++) {
      Node fieldNode = formFields.item(i);
      if(fieldNode instanceof HTMLInputElement) {
        processFormInputField(form, (HTMLInputElement) fieldNode);
      } else if (fieldNode instanceof HTMLElement) {
        processFormHTMLElement(form, (HTMLElement) fieldNode);
      } else {
View Full Code Here


    final IHTMLParseResult html = response.getParsedHTML();
    if(html == null)
      return;

    final HTMLDocument document = html.getDOMDocument();
    final HTMLCollection forms = document.getForms();

    for(int i = 0; i < forms.getLength(); i++) {
      Node n = forms.item(i);
      if(n instanceof Element) {
        processFormElement(ctx, request, (Element) n);
      }
    }
  }
View Full Code Here

      parent = parentNode;
      while (parent != null && parent.name != "table") {
        parent = parent.parentNode;
      }
      if (parent == null) return -1;
      HTMLCollection nl = ((HTMLTableElement)parent).getRows();
      for (int i=0;i<nl.getLength();i++) {
        Node n = nl.item(i);
        if (n == this) return i;
      }
        return -1;
    }
View Full Code Here

     * @see org.w3c.dom.html.HTMLTableRowElement#insertCell(int)
     */
    public HTMLElement insertCell(int index)
        throws DOMException {
    CHTMLTdElement tr = new CHTMLTdElement(ownerDocument);
    HTMLCollection nl = getCells();
    if (index == -1) index = nl.getLength();
    if (index < 0 || index > nl.getLength()) {
      throw new DOMException(DOMException.INDEX_SIZE_ERR,index+" > "+nl.getLength()+" ,array index out of bound.");
    }
    if (nl.getLength() == 0) {
      appendChild(tr);
    } else {
        boolean inserted = false;
        Node lastNode = null;
        for (int i=0;i<nl.getLength();i++) {
          Node n = nl.item(i);
          if (i == index) {
            n.getParentNode().insertBefore(tr,n);
            inserted = true;
            lastNode = null;
            break;
View Full Code Here

     *
     * @see org.w3c.dom.html.HTMLTableRowElement#deleteCell(int)
     */
    public void deleteCell(int index)
        throws DOMException {
    HTMLCollection nl = getCells();
    if (index == -1) index = nl.getLength()-1;
    if (index < 0 || index >= nl.getLength()) {
      throw new DOMException(DOMException.INDEX_SIZE_ERR,index+" > "+nl.getLength()+" ,array index out of bound.");
    }
      for (int i=0;i<nl.getLength();i++) {
        Node n = nl.item(i);
        if (i == index) {
          n.getParentNode().removeChild(n);
          break;
        }
      }
View Full Code Here

     * @see org.w3c.dom.html.HTMLTableElement#insertRow(int)
     */
    public HTMLElement insertRow(int index)
        throws DOMException {
        CHTMLTrElement tr = new CHTMLTrElement(ownerDocument);
        HTMLCollection nl = getRows();
        if (index == -1) index = nl.getLength();
        if (index < 0 || index > nl.getLength()) {
          throw new DOMException(DOMException.INDEX_SIZE_ERR,index+" > "+nl.getLength()+" ,array index out of bound.");
        }
        if (nl.getLength() == 0) {
          CHTMLTbodyElement body = new CHTMLTbodyElement(ownerDocument);
          appendChild(body);
          body.appendChild(tr);
        } else {
          boolean inserted = false;
          Node lastNode = null;
          for (int i=0;i<nl.getLength();i++) {
            Node n = nl.item(i);
            if (i == index) {
              n.getParentNode().insertBefore(tr,n);
              inserted = true;
              lastNode = null;
              break;
View Full Code Here

     *
     * @see org.w3c.dom.html.HTMLTableElement#deleteRow(int)
     */
    public void deleteRow(int index)
        throws DOMException {
    HTMLCollection nl = getRows();
    if (index == -1) index = nl.getLength()-1;
    if (index < 0 || index >= nl.getLength()) {
      throw new DOMException(DOMException.INDEX_SIZE_ERR,index+" > "+nl.getLength()+" ,array index out of bound.");
    }
      for (int i=0;i<nl.getLength();i++) {
        Node n = nl.item(i);
        if (i == index) {
          n.getParentNode().removeChild(n);
          break;
        }
      }
View Full Code Here

      parent = parentNode;
      while (parent != null && parent.name != "tr") {
        parent = parent.parentNode;
      }
      if (parent == null) return -1;
      HTMLCollection nl = ((HTMLTableRowElement)parent).getCells();
      for (int i=0;i<nl.getLength();i++) {
        Node n = nl.item(i);
        if (n == this) return i;
      }
        return -1;
    }
View Full Code Here

      parent = parentNode;
      while (parent != null && parent.name != "tr") {
        parent = parent.parentNode;
      }
      if (parent == null) return -1;
      HTMLCollection nl = ((HTMLTableRowElement)parent).getCells();
      for (int i=0;i<nl.getLength();i++) {
        Node n = nl.item(i);
        if (n == this) return i;
      }
        return -1;
    }
View Full Code Here

  public void processForms(IInjectionModuleContext ctx, HttpUriRequest request, IHttpResponse response) {
    final IHTMLParseResult html = response.getParsedHTML();
    if(html == null)
      return;

    final HTMLDocument document = html.getDOMDocument();
    final HTMLCollection forms = document.getForms();

    for(int i = 0; i < forms.getLength(); i++) {
      Node n = forms.item(i);
      if(n instanceof Element) {
        processFormElement(ctx, request, (Element) n);
View Full Code Here

TOP

Related Classes of org.w3c.dom.html2.HTMLHeadElement

Copyright © 2018 www.massapicom. 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.