Package org.htmlparser

Examples of org.htmlparser.Node


    }

    public void collectInto(NodeList collectionList, String filter)
    {
        super.collectInto(collectionList, filter);
        Node node;
        for (SimpleNodeIterator e = children(); e.hasMoreNodes();)
        {
            node = e.nextNode();
            node.collectInto(collectionList, filter);
        }
    }
View Full Code Here


    public String getChildrenHTML()
    {
        StringBuffer buff = new StringBuffer();
        for (SimpleNodeIterator e = children(); e.hasMoreNodes();)
        {
            Node node = (Node) e.nextNode();
            buff.append(node.toHtml());
        }
        return buff.toString();
    }
View Full Code Here

        {
            startTag.accept(visitor);
            SimpleNodeIterator children = children();
            while (children.hasMoreNodes())
            {
                Node child = (Node) children.nextNode();
                child.accept(visitor);
            }
            endTag.accept(visitor);
        }
        if (visitor.shouldRecurseSelf())
            visitor.visitTag(this);
View Full Code Here

    {
        NodeList nodeList = searchFor(searchText);
        NodeList stringNodes = new NodeList();
        for (int i = 0; i < nodeList.size(); i++)
        {
            Node node = nodeList.elementAt(i);
            if (node instanceof StringNode)
            {
                stringNodes.add(node);
            }
            else
View Full Code Here

        NodeIterator expectedIterator = expectedParser.elements();
        NodeIterator actualIterator = resultParser.elements();
        displayMessage =
            createGenericFailureMessage(displayMessage, expected, actual);

        Node nextExpectedNode = null, nextActualNode = null;
        do
        {
            nextExpectedNode = getNextNodeUsing(expectedIterator);
            nextActualNode = getNextNodeUsing(actualIterator);
View Full Code Here

    }

    private Node getNextNodeUsing(NodeIterator nodeIterator)
        throws ParserException
    {
        Node nextNode;
        String text = null;
        do
        {
            nextNode = nodeIterator.nextNode();
            if (nextNode instanceof StringNode)
            {
                text = nextNode.toPlainTextString().trim();
            }
            else
                text = null;
        }
        while (text != null && text.length() == 0);
View Full Code Here

                {
                    assertAttributesMatch(
                        displayMessage,
                        expectedTag,
                        actualTag);
                    Node tempNode = actualEnumeration.nextNode();
                    assertTrue(
                        "should be an end tag but was "
                            + tempNode.getClass().getName(),
                        tempNode instanceof EndTag);
                    actualTag = (EndTag) tempNode;
                    String expectedTagName =
                        ParserUtils.removeChars(expectedTag.getTagName(), '/');
                    assertEquals(
View Full Code Here

        NodeList nestedBulletLists =
            ((CompositeTag) node[0]).searchFor(BulletList.class);
        assertEquals("bullets in first list", 2, nestedBulletLists.size());
        BulletList firstList = (BulletList) nestedBulletLists.elementAt(0);
        Bullet firstBullet = (Bullet) firstList.childAt(0);
        Node firstNodeInFirstBullet = firstBullet.childAt(0);
        assertType(
            "first child in bullet",
            StringNode.class,
            firstNodeInFirstBullet);
        assertStringEquals(
            "expected text",
            "Energy supply\r\n" + " (Campbell)  ",
            firstNodeInFirstBullet.toPlainTextString());
    }
View Full Code Here

        FormTag formTag = (FormTag) node[0];
        LinkTag[] linkTag = new LinkTag[10];
        int i = 0;
        for (SimpleNodeIterator e = formTag.children(); e.hasMoreNodes();)
        {
            Node formNode = e.nextNode();
            if (formNode instanceof LinkTag)
            {
                linkTag[i++] = (LinkTag) formNode;
            }
        }
View Full Code Here

        FormTag formTag = (FormTag) node[0];
        RemarkNode[] remarkNode = new RemarkNode[10];
        int i = 0;
        for (SimpleNodeIterator e = formTag.children(); e.hasMoreNodes();)
        {
            Node formNode = (Node) e.nextNode();
            if (formNode instanceof RemarkNode)
            {
                remarkNode[i++] = (RemarkNode) formNode;
            }
        }
View Full Code Here

TOP

Related Classes of org.htmlparser.Node

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.