Package org.htmlparser

Examples of org.htmlparser.Tag.toHtml()


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


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

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

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

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

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

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

        createParser(html);
        parser.setNodeFactory (new PrototypicalNodeFactory (true));
        parseAndAssertNodeCount (1);
        assertType ("should be Tag", Tag.class, node[0]);
        Tag tag = (Tag)node[0];
        assertStringEquals ("html", html, tag.toHtml ());
    }

    /**
     * Test the toHTML method for a missing value attribute.
     */
 
View Full Code Here

        createParser(html);
        parser.setNodeFactory (new PrototypicalNodeFactory (true));
        parseAndAssertNodeCount (1);
        assertType ("should be Tag", Tag.class, node[0]);
        Tag tag = (Tag)node[0];
        assertStringEquals ("html", html, tag.toHtml ());
    }
}
View Full Code Here

        parser.setNodeFactory (new PrototypicalNodeFactory (true));
        parseAndAssertNodeCount(9);
        // The node should be an Tag
        assertTrue("1st Node should be a Tag",node[0] instanceof Tag);
        Tag tag = (Tag)node[0];
        assertStringEquals("toHTML()",tag1,tag.toHtml());
        assertTrue("3rd Node should be a Tag",node[2] instanceof Tag);
        assertTrue("5th Node should be a Tag",node[6] instanceof Tag);
        tag = (Tag)node[2];
        assertEquals("Raw String of the tag","<TITLE>",tag.toHtml());
        tag = (Tag)node[6];
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.