Package org.htmlparser

Examples of org.htmlparser.Parser.elements()


            vector.addElement (enumeration.nextNode ());

        data = pickle (parser);
        parser = (Parser)unpickle (data);

        enumeration = parser.elements ();
        while (enumeration.hasMoreNodes ())
            assertEquals (
                "Nodes before and after serialization differ",
                ((Node)vector.remove (0)).toHtml (),
                enumeration.nextNode ().toHtml ());
View Full Code Here


    {
        Parser parser;
        String url = "http://htmlparser.sourceforge.net/test/badtable2.html";

        parser = new Parser (url);
        for (NodeIterator e = parser.elements();e.hasMoreNodes();)
            e.nextNode();
        // Note: The test will throw a StackOverFlowException,
        // so we are successful if we get to here...
        assertTrue ("Crash", true);
    }
View Full Code Here

        try
        {
          parser = new Parser (mURLField.getText ());
          try
          {
            for (NodeIterator iterator = parser.elements (); iterator.hasMoreNodes (); )
                list.add (iterator.nextNode ());
          }
          catch (EncodingChangeException ece)
          {
              list.removeAll ();
View Full Code Here

          }
          catch (EncodingChangeException ece)
          {
              list.removeAll ();
              parser.reset ();
            for (NodeIterator iterator = parser.elements (); iterator.hasMoreNodes (); )
                list.add (iterator.nextNode ());
          }
        }
        catch (ParserException pe)
        {
View Full Code Here

        NodeIterator iterator;
       
        parser = new Parser ("http://www.009.com/");
        try
        {
            iterator = parser.elements ();
            while (iterator.hasMoreNodes ())
                checkTagNames (iterator.nextNode ());
        }
        catch (EncodingChangeException ece)
        {
View Full Code Here

                checkTagNames (iterator.nextNode ());
        }
        catch (EncodingChangeException ece)
        {
            parser.reset ();
            iterator = parser.elements ();
            while (iterator.hasMoreNodes ())
                checkTagNames (iterator.nextNode ());
        }
    }
View Full Code Here

        cdata = "<!--document.write(\"en\");// -->";
        endtag = "</script>";
        html = tag + cdata + endtag;
        parser = new Parser ();
        parser.setInputHTML (html);
        iterator = parser.elements ();
        node = iterator.nextNode ();
        if (node == null)
            fail ("too few nodes");
        else
            assertStringEquals ("bad parse", html, node.toHtml());
View Full Code Here

            "url(http://di.image.eshop.msn.com/img/sys/dot.gif)}";
        endtag = "</style>";
        html = tag + cdata + endtag;
        parser = new Parser ();
        parser.setInputHTML (html);
        iterator = parser.elements ();
        node = iterator.nextNode ();
        if (node == null)
            fail ("too few nodes");
        else
            assertStringEquals ("bad parse", html, node.toHtml());
View Full Code Here

    Vector vector;
    NodeIterator enumeration;
    byte[] data;

    parser = new Parser("http://htmlparser.sourceforge.net/test/example.html");
    enumeration = parser.elements();
    vector = new Vector(50);
    while (enumeration.hasMoreNodes())
      vector.addElement(enumeration.nextNode());

    data = pickle(parser);
View Full Code Here

      vector.addElement(enumeration.nextNode());

    data = pickle(parser);
    parser = (Parser) unpickle(data);

    enumeration = parser.elements();
    while (enumeration.hasMoreNodes())
      assertEquals("Nodes before and after serialization differ", ((Node) vector.remove(0)).toHtml(),
          ((Node) enumeration.nextNode()).toHtml());
  }
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.