Examples of toPlainTextString()


Examples of org.htmlparser.Node.toPlainTextString()

    //Parser parser = Parser.createParser(new String(inputHtml.getBytes(),ISO8859_1));
    //�������еĽڵ�
    NodeList nodes = parser.extractAllNodesThatMatch(nodeFilter);
    for(int i=0;i<nodes.size();i++){
      Node node = nodes.elementAt(i);
      text.append(new String(node.toPlainTextString().getBytes(ISO8859_1)));
    }
    return text.toString();
  }

  /**
 
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

    assertEquals("ending line position",1,customTag.tagData.getEndLine());
   
    Node child = customTag.childAt(0);
    assertType("child",StringNode.class,child);
    StringNode text = (StringNode)child;
    assertStringEquals("child text","Hello",child.toPlainTextString());
  }

  public void testCompositeTagWithTagChild() throws ParserException {
    createParser(
      "<Custom>" +
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

        if (!caseSensitive)
            searchString = searchString.toUpperCase();
        for (SimpleNodeIterator e = children(); e.hasMoreNodes();)
        {
            node = e.nextNode();
            String nodeTextString = node.toPlainTextString();
            if (!caseSensitive)
                nodeTextString = nodeTextString.toUpperCase();
            if (nodeTextString.indexOf(searchString) != -1)
            {
                foundList.add(node);
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

        Node node;
        int loc = 0;
        for (SimpleNodeIterator e = children(); e.hasMoreNodes();)
        {
            node = e.nextNode();
            if (node
                .toPlainTextString()
                .toUpperCase()
                .indexOf(text.toUpperCase())
                != -1)
            {
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

        do
        {
            nextNode = nodeIterator.nextNode();
            if (nextNode instanceof StringNode)
            {
                text = nextNode.toPlainTextString().trim();
            }
            else
                text = null;
        }
        while (text != null && text.length() == 0);
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

            StringNode.class,
            firstNodeInFirstBullet);
        assertStringEquals(
            "expected text",
            "Energy supply\r\n" + " (Campbell)  ",
            firstNodeInFirstBullet.toPlainTextString());
    }
}
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

    public static String getGraphSourceString(String html) {
        try {
            Parser parser = new Parser(html);
            Node node = getElementById(parser, GRAPH_STRING_ID);
            return node != null ? node.toPlainTextString().replaceAll(
                    LINE_BREAK, "\n") : "";
        } catch (ParserException e) {
            e.printStackTrace();
        }
        return "";
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

        // This is a level 2 span
        try {
            Parser parser = new Parser(TEST_STRING);
            Node node = getElementById(parser, "L2");
            if (node != null) {
                System.out.println(node.toPlainTextString());
            } else {
                System.out.println("null");
            }
        } catch (ParserException e) {
            // TODO Auto-generated catch block
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

 
  public String getGraphSourceString(String html) {
    try {
      Parser parser = new Parser(html);
      Node node = getElementById(parser, GRAPH_STRING_ID);
      return node != null ? node.toPlainTextString().replaceAll(LINE_BREAK, "\n") : "";
    } catch (ParserException e) {
      e.printStackTrace();
    }
    return "";
  }
View Full Code Here

Examples of org.htmlparser.Node.toPlainTextString()

    //      This is a level 2 span
    try {
      Parser parser = new Parser(TEST_STRING);
      Node node = getElementById(parser, "L2");
      if (node != null) {
        System.out.println(node.toPlainTextString());
      } else {
        System.out.println("null");
      }
    } catch (ParserException e) {
      // TODO Auto-generated catch block
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.