Package org.htmlparser.nodes

Examples of org.htmlparser.nodes.TextNode


    }

    public Cell(String contents) {
      if (contents == null)
        contents = "";
      TextNode text = new TextNode(contents);
      text.setChildren(new NodeList());
      columnNode = (TableColumn) newTag(TableColumn.class);
      columnNode.setChildren(new NodeList(text));
      originalContent = contents;
    }
View Full Code Here


      }
      return qualifiesAsHtml(unescaped) ? unescaped : HtmlUtil.unescapeHTML(unescaped);
    }

    private void setContent(String s) {
      TextNode textNode = new TextNode(s);
      NodeList nodeList = new NodeList(textNode);
      columnNode.setChildren(nodeList);
    }
View Full Code Here

  private HtmlTable makeMockTable(String tableIdentifier) {
    // Create just enough "table" to test if
    TableTag tableTag = new TableTag();
    TableRow tableRow = new TableRow();
    TableColumn tableColumn = new TableColumn();
    tableColumn.setChildren(new NodeList(new TextNode(tableIdentifier)));
    tableRow.setChildren(new NodeList(tableColumn));
    tableTag.setChildren(new NodeList(tableRow));
    return new HtmlTable(tableTag);
  }
View Full Code Here

      remarkNode.setText(jsBlockTrans.transform(context,
        remarkNode.getText()));
      emit(context, null, node, null);

    } else if (NodeUtils.isTextNode(node)) {
      TextNode textNode = (TextNode)node;
      if (context.isInCSS()) {
        handleCSSTextNode(context, textNode);
      } else if (context.isInScriptText()) {
        handleJSTextNode(context, textNode);
      }
      emit(context, null, textNode, null);
//        handleContentTextNode(context,textNode);
    } else if (NodeUtils.isTagNode(node)) {
      TagNode tagNode = (TagNode)node;

      if (tagNode.isEndTag()) {
        if (tagNode.getTagName().equals("HEAD")) {
          context.putData(FERRET_IN_HEAD, null);
        }

        if (checkAllowTag(pContext, tagNode)) {
          emit(context, null, tagNode, null);
        }

//        handleCloseTagNode(context,tagNode);
      } else if (tagNode.getTagName().startsWith("![CDATA[")) {
        // CDATA section is delivered as TagNode, and it
        // appears there's no ordinary way of replacing its
        // body content. Also CSS/JS handling method wants
        // TextNode. Create a temporary TextNode for them,
        // and write "<![CDATA["..."]]>" around it.
        String text = tagNode.getText();
        int s = "![CDATA[".length();
        // text is supposed to end with "]]", but just in case.
        int e = text.endsWith("]]") ? text.length() - 2 : text.length();
        if (context.isInCSS()) {
          TextNode textNode = new TextNode(text.substring(s, e));
          handleCSSTextNode(context, textNode);
          emit(context, "<![CDATA[", textNode, "]]>");
        } else if (context.isInScriptText()) {
          TextNode textNode = new TextNode(text.substring(s, e));
          handleJSTextNode(context, textNode);
          emit(context, "<![CDATA[", textNode, "]]>");
        } else {
          emit(context, null, tagNode, null);
        }
View Full Code Here

    if(NodeUtils.isRemarkNode(node)) {
      RemarkNode remarkNode = (RemarkNode) node;
      handleRemarkTextNode(context,remarkNode);
     
    } else if(NodeUtils.isTextNode(node)) {
      TextNode textNode = (TextNode) node;
      if(context.isInCSS()) {
        handleCSSTextNode(context,textNode);
       
      } else if(context.isInScriptText()) {
        handleJSTextNode(context,textNode);
View Full Code Here

TOP

Related Classes of org.htmlparser.nodes.TextNode

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.