Package org.htmlparser.tags

Examples of org.htmlparser.tags.TableColumn


        createParser(HTML_WITH_SPAN);
        parser.addScanner(new TableScanner(parser));
        parser.addScanner(new SpanScanner());
        parseAndAssertNodeCount(1);
        assertType("node", TableColumn.class, node[0]);
        TableColumn col = (TableColumn) node[0];
        Node spans[] = col.searchFor(Span.class).toNodeArray();
        assertEquals("number of spans found", 2, spans.length);
        assertStringEquals(
            "span 1",
            "Flavor: small(90 to 120 minutes)",
            spans[0].toPlainTextString());
View Full Code Here


        parser.registerScanners();
        //    parser.addScanner(new TableScanner(parser));
        parseAndAssertNodeCount(2);
        assertType("first node type", TableRow.class, node[0]);
        TableRow row = (TableRow) node[0];
        TableColumn col = row.getColumns()[1];
        Node node = col.children().nextNode();
        assertType(
            "Node identified should be HTMLLinkTag",
            LinkTag.class,
            node);
        LinkTag linkTag = (LinkTag) node;
View Full Code Here

        // Register the image scanner
        parser.registerScanners();
        parser.addScanner(new TableScanner(parser));
        parseAndAssertNodeCount(1);
        assertType("node should be", TableColumn.class, node[0]);
        TableColumn col = (TableColumn) node[0];
        Node node = col.children().nextNode();
        assertType("node inside column", ImageTag.class, node);
        ImageTag imageTag = (ImageTag) node;
        // Get the data from the node
        assertEquals(
            "Image location",
View Full Code Here

        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

            allowSelfChildren);
    }

    public Tag createTag(TagData tagData, CompositeTagData compositeTagData)
    {
        return new TableColumn(tagData, compositeTagData);
    }
View Full Code Here

      }
    }
   
    private Assertion assertion() throws SyntaxError {
    NodeList headerColumns = new NodeList();
    headerColumns.add(new TableColumn());
    TableHeader tableHeader = new TableHeader();
    tableHeader.setChildren(headerColumns);
    NodeList rowColumns = new NodeList();
    rowColumns.add(new TableColumn());
    TableRow tableRow = new TableRow();
    tableRow.setChildren(rowColumns);
    NodeList rows = new NodeList();
    rows.add(tableHeader);
    rows.add(tableRow);
View Full Code Here

        registerTag (new ParagraphTag ());
        registerTag (new ProcessingInstructionTag ());
        registerTag (new ScriptTag ());
        registerTag (new SelectTag ());
        registerTag (new StyleTag ());
        registerTag (new TableColumn ());
        registerTag (new TableHeader ());
        registerTag (new TableRow ());
        registerTag (new TableTag ());
        registerTag (new TextareaTag ());
        registerTag (new TitleTag ());
View Full Code Here

            HTML_WITH_SPAN
        );
        parser.setNodeFactory (
            new PrototypicalNodeFactory (
                new Tag[] {
                    new TableColumn (),
                    new Span (),
                }));
        parseAndAssertNodeCount(1);
        assertType("node",TableColumn.class,node[0]);
        TableColumn col = (TableColumn)node[0];
        Node spans [] = col.searchFor(Span.class, true).toNodeArray();
        assertEquals("number of spans found",2,spans.length);
        assertStringEquals(
            "span 1",
            "Flavor: small(90 to 120 minutes)",
            spans[0].toPlainTextString()
View Full Code Here

            "</tr>","http://www.yahoo.com",30
        );
        parseAndAssertNodeCount(2);
        assertType("first node type",TableRow.class,node[0]);
        TableRow row = (TableRow)node[0];
        TableColumn col = row.getColumns()[1];
        Node node = col.children().nextNode();
        assertType("Node identified should be HTMLLinkTag",LinkTag.class,node);
        LinkTag linkTag = (LinkTag)node;
        Node nodeInsideLink = linkTag.children().nextNode();
        assertType("Tag within link should be an image tag",ImageTag.class,nodeInsideLink);
        ImageTag imageTag = (ImageTag)nodeInsideLink;
View Full Code Here

            "</td>",
            "http://www.cia.gov"
        );
        parseAndAssertNodeCount(1);
        assertType("node should be", TableColumn.class, node[0]);
        TableColumn col = (TableColumn)node[0];
        Node node = col.children().nextNode();
        assertType("node inside column",ImageTag.class,node);
        ImageTag imageTag = (ImageTag)node;
        // Get the data from the node
        assertEquals("Image location","http://www.cia.gov/graphics/images_home2/cia_banners_template3_01.gif",imageTag.getImageURL());
        assertEquals("Alt Value","Central Intelligence Agency, Director of Central Intelligence",imageTag.getAttribute("ALT"));
View Full Code Here

TOP

Related Classes of org.htmlparser.tags.TableColumn

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.