Examples of EndTag


Examples of org.htmlparser.tags.EndTag

  protected Tag getInsertedEndTag(Tag tag, NodeReader reader, String currentLine) {
    // Insert end tag
    String newLine = insertEndTagBeforeNode(tag, currentLine);
    reader.changeLine(newLine);
    return new EndTag(new TagData(tag.elementBegin(), tag.elementBegin() + 3, tag.getTagName(), currentLine));
  }
View Full Code Here

Examples of org.htmlparser.tags.EndTag

    Node node;
    MetaTag meta;
    String httpEquiv;
    String charset;
    boolean restart;
    EndTag end;
    IteratorImpl ret;

    remove_scanner = false;
    restart = false;
    ret = new IteratorImpl(reader, resourceLocn, feedback);
View Full Code Here

Examples of org.htmlparser.tags.EndTag

  public IteratorImpl createIteratorImpl(boolean remove_scanner, IteratorImpl ret) throws ParserException {
    Node node;
    MetaTag meta;
    String httpEquiv;
    String charset;
    EndTag end;
    if (null != url_conn)
      try {
        if (null == scanners.get("-m")) {
          addScanner(new MetaTagScanner("-m"));
          remove_scanner = true;
        }

        /* pre-read up to </HEAD> looking for charset directive */
        while (null != (node = ret.peek())) {
          if (node instanceof MetaTag) { // check for charset on
                          // Content-Type
            meta = (MetaTag) node;
            httpEquiv = meta.getAttribute("HTTP-EQUIV");
            if ("Content-Type".equalsIgnoreCase(httpEquiv)) {
              charset = getCharset(meta.getAttribute("CONTENT"));
              if (!charset.equalsIgnoreCase(character_set)) { // oops,
                                      // different
                                      // character
                                      // set,
                                      // restart
                character_set = charset;
                recreateReader();
                ret = new IteratorImpl(reader, resourceLocn, feedback);
              }
              // once we see the Content-Type meta tag we're
              // finished the pre-read
              break;
            }
          } else if (node instanceof EndTag) {
            end = (EndTag) node;
            if (end.getTagName().equalsIgnoreCase("HEAD"))
              // or, once we see the </HEAD> tag we're finished
              // the pre-read
              break;
          }
        }
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.