Package org.htmlparser.tags

Examples of org.htmlparser.tags.Tag.toHtml()


    {
        createParser("<meta name=\"foo\" content=\"foobar>\">");
        parseAndAssertNodeCount(1);
        assertType("should be Tag", Tag.class, node[0]);
        Tag tag = (Tag) node[0];
        String html = tag.toHtml();
        assertStringEquals(
            "html",
            "<META CONTENT=\"foobar>\" NAME=\"foo\">",
            html);
        String attribute1 = tag.getAttribute("NAME");
View Full Code Here


    {
        createParser("<meta name=\"foo\" content=\"foo\nbar>\">");
        parseAndAssertNodeCount(1);
        assertType("should be Tag", Tag.class, node[0]);
        Tag tag = (Tag) node[0];
        String html = tag.toHtml();
        assertStringEquals(
            "html",
            "<META CONTENT=\"foo\r\nbar>\" NAME=\"foo\">",
            html);
        String attribute1 = tag.getAttribute("NAME");
View Full Code Here

        if (1.4 <= Parser.getVersionNumber())
        {
            parseAndAssertNodeCount(1);
            assertType("should be Tag", Tag.class, node[0]);
            Tag tag = (Tag) node[0];
            String html = tag.toHtml();
            assertStringEquals(
                "html",
                "<META CONTENT=\"<foo>\r\nbar\" NAME=\"foo\">",
                html);
            String attribute1 = tag.getAttribute("NAME");
View Full Code Here

        if (1.4 <= Parser.getVersionNumber())
        {
            parseAndAssertNodeCount(1);
            assertType("should be Tag", Tag.class, node[0]);
            Tag tag = (Tag) node[0];
            String html = tag.toHtml();
            assertStringEquals(
                "html",
                "<META CONTENT=\"foo>\r\nbar\" NAME=\"foo\">",
                html);
            String attribute1 = tag.getAttribute("NAME");
View Full Code Here

        if (1.4 <= Parser.getVersionNumber())
        {
            parseAndAssertNodeCount(1);
            assertType("should be Tag", Tag.class, node[0]);
            Tag tag = (Tag) node[0];
            String html = tag.toHtml();
            assertStringEquals(
                "html",
                "<META CONTENT=\"<foo\r\nbar\" NAME=\"foo\">",
                html);
            String attribute1 = tag.getAttribute("NAME");
View Full Code Here

            "jsp:useBean id=\"transfer\" scope=\"session\" class=\"com.bank.PageBean\"",
            htag.getText());
        assertStringEquals(
            "html",
            "<JSP:USEBEAN ID=\"transfer\" SCOPE=\"session\" CLASS=\"com.bank.PageBean\"/>",
            htag.toHtml());
        // The third node should be an HTMLJspTag
        assertTrue("Node 3 should be an HTMLJspTag", node[2] instanceof JspTag);
        JspTag tag2 = (JspTag) node[2];
        String expected =
            "\r\n"
View Full Code Here

    createParser(testHTML);
    parseAndAssertNodeCount(7);
    // The node should be an Tag
    assertTrue("1st Node should be a Tag", node[0] instanceof Tag);
    Tag tag = (Tag) node[0];
    assertStringEquals("toHTML()", "<MYTAG EFGH=\"\" ABCD=\"\" MNOP=\"\" IJKL=\"\">", tag.toHtml());
    assertTrue("2nd Node should be a Tag", node[1] instanceof Tag);
    assertTrue("5th Node should be a Tag", node[4] instanceof Tag);
    tag = (Tag) node[1];
    assertEquals("Raw String of the tag", "<TITLE>", tag.toHtml());
    tag = (Tag) node[4];
View Full Code Here

    Tag tag = (Tag) node[0];
    assertStringEquals("toHTML()", "<MYTAG EFGH=\"\" ABCD=\"\" MNOP=\"\" IJKL=\"\">", tag.toHtml());
    assertTrue("2nd Node should be a Tag", node[1] instanceof Tag);
    assertTrue("5th Node should be a Tag", node[4] instanceof Tag);
    tag = (Tag) node[1];
    assertEquals("Raw String of the tag", "<TITLE>", tag.toHtml());
    tag = (Tag) node[4];
    assertEquals("Raw String of the tag", "<A HREF=\"Hello.html\">", tag.toHtml());
  }

  /**
 
View Full Code Here

    assertTrue("2nd Node should be a Tag", node[1] instanceof Tag);
    assertTrue("5th Node should be a Tag", node[4] instanceof Tag);
    tag = (Tag) node[1];
    assertEquals("Raw String of the tag", "<TITLE>", tag.toHtml());
    tag = (Tag) node[4];
    assertEquals("Raw String of the tag", "<A HREF=\"Hello.html\">", tag.toHtml());
  }

  /**
   * Test parseParameter method Created by Kaarle Kaila (22 Oct 2001) This
   * test just wants the text in the element
View Full Code Here

    createParser(testHTML);
    parseAndAssertNodeCount(2);
    assertTrue("First node should be an HTMLtag", node[0] instanceof Tag);
    Tag htmlTag = (Tag) node[0];
    String expectedHTML = "<TEXTAREA NAME=\"JohnDoe\">";
    assertStringEquals("Expected HTML", expectedHTML, htmlTag.toHtml());
  }

  public void testIgnoreState() throws ParserException {
    String testHTML = "<A \n"
        + "HREF=\"/a?b=c>d&e=f&g=h&i=http://localhost/Testing/Report1.html\">20020702 Report 1</A>";
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.