Package org.htmlparser

Examples of org.htmlparser.StringNode.toPlainTextString()


    assertTrue("Fourth Node identified must be a string node", node[3] instanceof StringNode);
    StringNode stringNode = (StringNode) node[3];
    assertEquals("First String Node", "This is the Title", stringNode.toPlainTextString());
    assertTrue("Eighth Node identified must be a string node", node[7] instanceof StringNode);
    stringNode = (StringNode) node[7];
    assertEquals("Second string node", "Hello World, this is the HTML Parser", stringNode.toPlainTextString());
  }

  public void testToHTML() throws ParserException {
    createParser("<HTML><HEAD><TITLE>This is the Title</TITLE></HEAD><BODY>Hello World, this is the HTML Parser</BODY></HTML>");
    parseAndAssertNodeCount(10);
View Full Code Here


  public void testStringWithLineBreaks() throws Exception {
    createParser("Testing &\nRefactoring");
    parseAndAssertNodeCount(1);
    assertType("first node", StringNode.class, node[0]);
    StringNode stringNode = (StringNode) node[0];
    assertStringEquals("text", "Testing &\r\nRefactoring", stringNode.toPlainTextString());
  }

}
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.