Examples of TableTag


Examples of org.htmlparser.tags.TableTag

                    "</tr>" +
                "</table>" +
            "</table>"
        );
        parseAndAssertNodeCount(1);
        TableTag tableTag = (TableTag)node[0];
        Text [] stringNode =
            tableTag.digupStringNode("Hello World");

        assertEquals("number of string nodes",1,stringNode.length);
        assertNotNull("should have found string node",stringNode);
        CompositeTag parent = (CompositeTag)stringNode[0].getParent();
        int pos = parent.findPositionOf(stringNode[0]);
View Full Code Here

Examples of org.htmlparser.tags.TableTag

            + "</tr>\n"
            + "</table>";
        createParser (html);
        parseAndAssertNodeCount (1);
        assertType ("table", TableTag.class, node[0]);
        TableTag table = (TableTag)node[0];
        assertTrue ("table should have 3 nodes", 3 == table.getChildCount ());
        assertType ("row", TableRow.class, table.childAt (1));
        TableRow row = (TableRow)table.childAt (1);
        assertTrue ("row should have 3 nodes", 3 == row.getChildCount ());
        assertType ("column", TableColumn.class, row.childAt (1));
        TableColumn column = (TableColumn)row.childAt (1);
        assertTrue ("column should have 1 node", 1 == column.getChildCount ());
        assertType ("element", Div.class, column.childAt (0));
View Full Code Here

Examples of org.htmlparser.tags.TableTag

    public void testScan() throws ParserException
    {
        createParser(createHtmlWithTable());
        parseAndAssertNodeCount(1);
        assertTrue(node[0] instanceof TableTag);
        TableTag tableTag = (TableTag)node[0];
        assertEquals("rows",1,tableTag.getRowCount());
        TableRow row = tableTag.getRow(0);
        assertEquals("columns in row 1",2,row.getColumnCount());
        assertEquals("table width","100.0%",tableTag.getAttribute("WIDTH"));
    }
View Full Code Here

Examples of org.htmlparser.tags.TableTag

        parseAndAssertNodeCount(1);
        assertType("only tag should be a HTML tag", Html.class,node[0]);
        Html html = (Html)node[0];
        assertEquals("html tag should have 4 children", 4, html.getChildCount ());
        assertType("second tag",TableTag.class,html.getChild (1));
        TableTag table = (TableTag)html.getChild (1);
        assertEquals("rows",3,table.getRowCount());
        TableRow tr = table.getRow(2);
        assertEquals("columns",1,tr.getColumnCount());
        TableColumn td = tr.getColumns()[0];
        Node node = td.childAt(1);
        assertType("node",TableTag.class,node);
        TableTag table2 = (TableTag)node;
        assertEquals("second table row count",1,table2.getRowCount());
        tr = table2.getRow(0);
        assertEquals("second table col count",2,tr.getColumnCount());
    }
View Full Code Here

Examples of org.htmlparser.tags.TableTag

            new PrototypicalNodeFactory (
                new Tag[]
                {
                    new Div (),
                    new Span (),
                    new TableTag (),
                }));
        parseAndAssertNodeCount(1);
        TableTag tableTag = (TableTag)node[0];
        Node[] spans = ParserUtils.findTypeInNode (tableTag, Span.class);
        assertSpanContent(spans);
    }
View Full Code Here

Examples of org.htmlparser.tags.TableTag

                    new InputTag (),
                    new TextareaTag (),
                    new SelectTag (),
                    new OptionTag (),
                    new LinkTag (),
                    new TableTag (),
                }));
        parseAndAssertNodeCount(1);
        assertTrue("Should be a HTMLFormTag",node[0] instanceof FormTag);
        NodeList linkTags = new NodeList ();
        NodeClassFilter filter = new NodeClassFilter (LinkTag.class);
View Full Code Here

Examples of org.htmlparser.tags.TableTag

                    new FormTag (),
                    new InputTag (),
                    new TextareaTag (),
                    new SelectTag (),
                    new OptionTag (),
                    new TableTag (),
                }));
        parseAndAssertNodeCount(1);
        assertTrue("Should be a HTMLFormTag",node[0] instanceof FormTag);
        NodeList remarkNodes = new NodeList ();
        NodeClassFilter filter = new NodeClassFilter (Remark.class);
View Full Code Here

Examples of org.htmlparser.tags.TableTag

   
    public void testScan() throws ParserException {
        createParser("<table><div align=\"left\">some text</div></table>");
        parseAndAssertNodeCount(1);
        assertType("node should be table",TableTag.class,node[0]);
        TableTag tableTag = (TableTag)node[0];
        Div div = (Div)tableTag.searchFor(Div.class, true).toNodeArray()[0];
        assertEquals("div contents","some text",div.toPlainTextString());
    }
View Full Code Here

Examples of org.htmlparser.tags.TableTag

    parser.registerScanners();
    parser.addScanner(new TableScanner(parser));
    parser.addScanner(new DivScanner());
    parseAndAssertNodeCount(1);
    assertType("node should be table", TableTag.class, node[0]);
    TableTag tableTag = (TableTag) node[0];
    Div div = (Div) tableTag.searchFor(Div.class).toNodeArray()[0];
    assertEquals("div contents", "some text", div.toPlainTextString());
  }
View Full Code Here

Examples of org.htmlparser.tags.TableTag

        + "<table border>\n" + "<tr>\n" + "<td>table2 Head1</td>\n" + "<td>table2 Val1</td>\n" + "</tr>\n"
        + "</table>\n" + "</td>\n" + "</tr>\n" + "</BODY>\n" + "</HTML>");
    parser.registerScanners();
    parseAndAssertNodeCount(4);
    assertType("second tag", TableTag.class, node[1]);
    TableTag table = (TableTag) node[1];
    assertEquals("rows", 3, table.getRowCount());
    TableRow tr = table.getRow(2);
    assertEquals("columns", 1, tr.getColumnCount());
    TableColumn td = tr.getColumns()[0];
    Node node = td.childAt(0);
    assertType("node", TableTag.class, node);
    TableTag table2 = (TableTag) node;
    assertEquals("second table row count", 1, table2.getRowCount());
    tr = table2.getRow(0);
    assertEquals("second table col count", 2, tr.getColumnCount());
  }
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.