I use htmlparser http://htmlparser.sourceforge.net/javadoc/index.html

Discussion in 'Java' started by mike, Jan 11, 2005.

  1. mike

    mike Guest

    regards:

    I use htmlparser http://htmlparser.sourceforge.net/javadoc/index.html
    to parse existing File test.htm
    and output to test2.txt.

    "javac ToHtmlDemo" is ok.
    but when
    "java ToHtmlDemo"

    exception say
    encoding change from ISO-8859-1 to Big5
    ----------------------------------


    Do I miss something important?
    Followings is my code.

    thank you
    May god be with you.

    ----------------------------------


    import org.htmlparser.Parser;
    import org.htmlparser.util.NodeIterator;
    import org.htmlparser.util.ParserException;
    import java.io.*;


    public class ToHtmlDemo
    {
    public static void main (String[] args) throws ParserException
    {
    try{

    FileOutputStream htmlparserOutput = new
    FileOutputStream("test2.txt");
    PrintWriter out=null;
    out = new PrintWriter(htmlparserOutput);
    Parser parser = new Parser ("test.htm");
    for (NodeIterator i = parser.elements();i.hasMoreNodes();){
    out.print(i.nextNode().toHtml ());}
    out.close();
    htmlparserOutput.close();
    }
    catch(IOException e)
    {
    }
    }
    }
     
    mike, Jan 11, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karthikeyavenkat
    Replies:
    2
    Views:
    602
    Bryce
    Mar 17, 2005
  2. alf
    Replies:
    0
    Views:
    283
  3. sharan
    Replies:
    1
    Views:
    721
    Pavel Lepin
    Oct 26, 2007
  4. NickPick
    Replies:
    5
    Views:
    1,377
  5. Tomasz Chmielewski

    sorting index-15, index-9, index-110 "the human way"?

    Tomasz Chmielewski, Mar 4, 2008, in forum: Perl Misc
    Replies:
    4
    Views:
    306
    Tomasz Chmielewski
    Mar 4, 2008
Loading...

Share This Page