Examples of tagName()


Examples of org.jsoup.nodes.Element.tagName()

  private boolean isBlock(Node n) {
    boolean block = false;
    if(n != null && n instanceof Element) {
      Element el = (Element)n;
      block = el.isBlock() || el.tagName().equals("br");
    }
    return block;
  }

  private String ltrim(String s) {
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

        currentNodeHandler.handleTextNode((TextNode) n, this);

      } else if(n instanceof Element) {
        // figure out who can handle this
        Element node = (Element)n;
        String tagName = node.tagName();

        if(nodeList.containsKey(tagName)) {
          // OK, we know how to handle this node
          nodeList.get(tagName).handleNode(currentNodeHandler, node, this);
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

        for (Node n: node.childNodes()) {
            if (n instanceof Element) {
                final Element child = (Element) n;

                //push form if this is a form tag
                if (child.tagName().equals("form"))
                    pc.form = (Element) n;

                //setup a lexical scope if we're going into a repeat widget (by reading the previous node)
                final boolean shouldPopScope = lexicalClimb(pc, child);
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

    private static String cleanHtml(final Node node) {
        if (node instanceof Element) {
            Element element = ((Element) node);
            StringBuilder accum = new StringBuilder();
            accum.append("<").append(element.tagName());
            for (Attribute attribute: element.attributes()) {
                if (!(attribute.getKey().startsWith("_"))) {
                    accum.append(" ");
                    accum.append(attribute.getKey());
                    accum.append("=\"");
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

            } else {
                accum.append(">");
                for (Node child : element.childNodes())
                    accum.append(cleanHtml(child));

                accum.append("</").append(element.tagName()).append(">");
            }
            return accum.toString();
        } else if (node instanceof TextNode) {
            return ((TextNode) node).getWholeText();
        } else if (node instanceof XmlDeclaration) {
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

      // enable annotations on data areas
      parseAnnotatableText (data, child);
    }

    // <base href>: update the base uri
    if (child.tagName().equals("base")) {
      String href = child.absUrl("href");
      if (!Strings.empty(href)) { // ignore <base target> etc
        baseUri = href;
        // TODO - consider updating baseUri for relevant elements in the stack, eg rebase(stack, uri)
        // doc.get().setBaseUri(href); // set on the doc so doc.createElement(Tag) will get updated base
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

                accum.append(txt);
            } else if (child instanceof Element) {
                Element element = (Element) child;
                if (accum.length() > 0 && element.isBlock() && !lastCharIsWhitespace(accum))
                    accum.append(" ");
                else if (element.tagName().equals("br"))
                    accum.append(" ");
                appendTextSkipHidden(element, accum);
            }
        }
    }
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

public class HTMLElementImpl extends ElementImpl implements HTMLElement, IInnerHtmlProvidingElement {

  static Element findEnclosingFormElement(Element insideElement) {
    Element e = insideElement;
    while(e != null) {
      if(e.tagName().toUpperCase().equals("FORM"))
        return e;
      e = e.parent();
    }
    return null;
  }
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

 
  static Element findEnclosingSelectElement(Element insideElement) {
   
    Element e = insideElement;
    while(e != null) {
      if(e.tagName().toUpperCase().equals("SELECT"))
        return e;
      e = e.parent();
    }
    return null;
  }
View Full Code Here

Examples of org.jsoup.nodes.Element.tagName()

        public void head(Node node, int depth) {
            if (!(node instanceof Element)) {
                return;
            }
            Element tag = (Element) node;
            String tagName = tag.tagName().toLowerCase();
            if (tagName.equals(TAG_BODY)) {
                extractAttribute(tag, ATT_BACKGROUND);
            } else if (tagName.equals(TAG_SCRIPT)) {
                extractAttribute(tag, ATT_SRC);
            } else if (tagName.equals(TAG_BASE)) {
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.