Re: [Htmlparser-user] parser termination callback
Brought to you by:
derrickoswald
From: Somik R. <so...@ya...> - 2003-03-11 02:50:58
|
Hi Joe, One suggestion is - pass the stream to the visitor, so you can close it outside. However, it might be a good idea to support a parseCompleted() event on the visitor interface. Regards, Somik --- Joe Lin <gu...@ya...> wrote: > Hi, > > I wrote a visitor and register with the Parser. > Basically I was paersing a web page and dump the > result to a file. I close the FileOutputStream in my > visitEndTag as such: > > public void visitEndTag(EndTag endTag) > { > if ( endTag.getTagName().equalsIgnoreCase("HTML") > ) > { > //flus and close the file outputstream > } > } > > However, my program is getting the IOException > saying > that the outputstream is closed while I was still > trying to write to it. I then realize that my "if" > statement in the visitEndTagis not a correct signal > for determining that the parser is done parsing. Can > anyone please help me find out if there's any way > that > I can know the parser is finished parsing? Thanks. > > Joe > > __________________________________________________ > Do you Yahoo!? > Yahoo! Tax Center - forms, calculators, tips, more > http://taxes.yahoo.com/ > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Htmlparser-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-user __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ |