Thread: RE: [Htmlparser-user] strip comments HTML source
Brought to you by:
derrickoswald
From: <dha...@or...> - 2003-02-06 09:27:02
Attachments:
BDY.RTF
|
I would love that and something similar for css and javascript files as well. -----Original Message----- From: aminudin [mailto:ami...@mi...] Sent: Thursday, February 06, 2003 2:50 PM To: htmlparser-user Cc: aminudin Subject: [Htmlparser-user] strip comments HTML source Hi, Is there any way / class that could strip all comments from HTML source and produce plain and clean HTML source without any comment . Thanks ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: <dha...@or...> - 2003-02-07 04:48:05
Attachments:
BDY.RTF
|
No no.....I would want all the conmments in a css/javascript file or code to be stripped out when the file is sent for deployment to the production site. This would decrease the size of the file substantially and allow faster loading of the same. Regards, Dhaval Udani Senior Analyst M-Line, QPEG OrbiTech Solutions Ltd. +91-22-28290019 Extn. 1457 -----Original Message----- From: joshua [mailto:jo...@in...] Sent: Thursday, February 06, 2003 10:20 PM To: htmlparser-user Cc: joshua Subject: Re: [Htmlparser-user] strip comments HTML source > I would love that and something similar for css and javascript files as > well. Are you saying you'd like to have any css/javascript data in an html page stripped out, so all you have it plain html? regards jk ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user |
From: ChennaDulla <che...@go...> - 2003-02-07 14:27:44
Attachments:
winmail.dat
|
hi i downloded htmlparser1.2 zip and i put htmlparser.jar file under lib on my server and org folder under web_inf ... it is wokring fine to convert html to text file but the problem is format of text file ... When i see text file after convertion the format is worst .. why is the happending like that ... no certain format by the time writing inot text file ... here is the code i am using to convert html to text file ... import org.htmlparser.util.HTMLEnumeration; import org.htmlparser.util.HTMLParserException; import org.htmlparser.HTMLNode; import org.htmlparser.HTMLParser; import java.io.*; import java.util.Properties; public class StringExtractor { // String htmlFile = "/export/a.html"; public StringExtractor() { } public void extractStrings(String htmlFile) throws HTMLParserException { try{ HTMLParser parser = new HTMLParser (htmlFile); BufferedWriter thewriter = new BufferedWriter (new FileWriter("/export/d.txt")); HTMLNode node; StringBuffer results= new StringBuffer(); for (HTMLEnumeration e = parser.elements ();e.hasMoreNodes();) { node = e.nextHTMLNode(); thewriter.write(node.toPlainTextString ()); } thewriter.close(); }catch(IOException e) { System.out.println ("error in ConvertJspToHtml.java==="+e ); } } } what changes i have to do to see html file in readable format .. if i run above file it the text file is generating but the format doesn't look good ... Any help on this please ... I am sending the one file as attachment .. i am getting output in text file like that. ... thanks. > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On Behalf Of > dha...@or... > Sent: Thursday, February 06, 2003 11:47 PM > To: htm...@li... > Subject: RE: [Htmlparser-user] strip comments HTML source > > << File: BDY.RTF >> << File: BDY.RTF >> |
From: Somik R. <so...@ya...> - 2003-02-08 06:03:25
|
Try : thewriter.write(HTMLParserUtils.removeEscapeCharacters(node.toPlainTextStrin g())); That should make it better. Regards, Somik ----- Original Message ----- From: "ChennaDulla" <che...@go...> To: <htm...@li...> Sent: Friday, February 07, 2003 6:26 AM Subject: [Htmlparser-user] format problem of text file after convertion of html to text file > hi i downloded htmlparser1.2 zip and i put htmlparser.jar > file under lib on my server and org folder under > web_inf ... it is wokring fine to convert html to text file > but the problem is format of text file ... > When i see text file after convertion the format is worst .. > why is the happending like that ... no certain format by > the time writing inot text file ... > here is the code i am using to convert html to text file ... > > import org.htmlparser.util.HTMLEnumeration; > import org.htmlparser.util.HTMLParserException; > import org.htmlparser.HTMLNode; > import org.htmlparser.HTMLParser; > import java.io.*; > import java.util.Properties; > > public class StringExtractor { > // String htmlFile = "/export/a.html"; > public StringExtractor() { > } > public void extractStrings(String htmlFile) throws > HTMLParserException { > try{ > HTMLParser parser = new HTMLParser > (htmlFile); > BufferedWriter thewriter = new BufferedWriter > (new FileWriter("/export/d.txt")); > HTMLNode node; > StringBuffer results= new StringBuffer(); > for (HTMLEnumeration e = parser.elements > ();e.hasMoreNodes();) { > node = e.nextHTMLNode(); > thewriter.write(node.toPlainTextString > ()); > } > thewriter.close(); > }catch(IOException e) { System.out.println > ("error in ConvertJspToHtml.java==="+e ); } > } > > } > > what changes i have to do to see html file in readable > format .. if i run above file it the text file is generating but > the format doesn't look good ... > Any help on this please ... > I am sending the one file as attachment .. i am getting > output in text file like that. ... > > thanks. > > > > -----Original Message----- > > From: htm...@li... > > [mailto:htm...@li...] On Behalf Of > > dha...@or... > > Sent: Thursday, February 06, 2003 11:47 PM > > To: htm...@li... > > Subject: RE: [Htmlparser-user] strip comments HTML source > > > > << File: BDY.RTF >> << File: BDY.RTF >> > |
From: Joshua K. <jo...@in...> - 2003-02-06 16:48:23
|
> I would love that and something similar for css and javascript files as > well. Are you saying you'd like to have any css/javascript data in an html page stripped out, so all you have it plain html? regards jk |