Package org.htmlparser

Examples of org.htmlparser.StringNode


    */
    public void testEmptyTagParseParameter() throws ParserException
    {
        Tag tag;
        EndTag etag;
        StringNode snode;
        Node node = null;
        String testHTML =
            "<INPUT name=\"foo\" value=\"foobar\" type=\"text\" />";

        createParser(testHTML);
View Full Code Here


        parser.registerScanners();
        parseAndAssertNodeCount(5);
        assertTrue(
            "Third node should be a string node",
            node[2] instanceof StringNode);
        StringNode stringNode = (StringNode) node[2];
        assertEquals(
            "Third node has incorrect text",
            "<>text",
            stringNode.getText());
    }
View Full Code Here

        parser.registerScanners();
        parseAndAssertNodeCount(5);
        assertTrue(
            "Third node should be a string node",
            node[2] instanceof StringNode);
        StringNode stringNode = (StringNode) node[2];
        assertEquals(
            "Third node has incorrect text",
            "text<>",
            stringNode.getText());
    }
View Full Code Here

        parser.registerScanners();
        parseAndAssertNodeCount(5);
        assertTrue(
            "Third node should be a string node",
            node[2] instanceof StringNode);
        StringNode stringNode = (StringNode) node[2];
        assertEquals(
            "Third node has incorrect text",
            "text<>text",
            stringNode.getText());
    }
View Full Code Here

        Parser.setLineSeparator("\r\n"); // actually a static method
        parseAndAssertNodeCount(5);
        assertTrue(
            "Third node should be a string node",
            node[2] instanceof StringNode);
        StringNode stringNode = (StringNode) node[2];
        String actual = stringNode.getText();
        assertEquals("Third node has incorrect text", "text\r\n<>text", actual);
    }
View Full Code Here

        Parser.setLineSeparator("\r\n"); // actually a static method
        parseAndAssertNodeCount(5);
        assertTrue(
            "Third node should be a string node",
            node[2] instanceof StringNode);
        StringNode stringNode = (StringNode) node[2];
        String actual = stringNode.getText();
        assertEquals("Third node has incorrect text", "text<\r\n>text", actual);
    }
View Full Code Here

        Parser.setLineSeparator("\r\n"); // actually a static method
        parseAndAssertNodeCount(5);
        assertTrue(
            "Third node should be a string node",
            node[2] instanceof StringNode);
        StringNode stringNode = (StringNode) node[2];
        String actual = stringNode.getText();
        assertEquals("Third node has incorrect text", "text<>\r\ntext", actual);
    }
View Full Code Here

                    i = -1;
                }

            }
        }
        return new StringNode(textBuffer, textBegin, textEnd);
    }
View Full Code Here

    assertEquals("starting line position",1,customTag.tagData.getStartLine());
    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());
  }
View Full Code Here

    assertType("first child",AnotherTag.class,node);
    AnotherTag anotherTag = (AnotherTag)node;
    assertEquals("another tag children count",1,anotherTag.getChildCount());
    node = anotherTag.childAt(0);
    assertType("nested child",StringNode.class,node);
    StringNode text = (StringNode)node;
    assertEquals("text","Hello",text.toPlainTextString());
  }
View Full Code Here

TOP

Related Classes of org.htmlparser.StringNode

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.