~ubuntu-branches/ubuntu/saucy/libhtmlcleaner-java/saucy-proposed

« back to all changes in this revision

Viewing changes to src/test/java/org/htmlcleaner/Working.java

  • Committer: Package Import Robot
  • Author(s): Alexandre Rossi
  • Date: 2011-05-26 15:05:58 UTC
  • Revision ID: package-import@ubuntu.com-20110526150558-scdb2th5p2rmw1op
Tags: upstream-2.2
ImportĀ upstreamĀ versionĀ 2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.htmlcleaner;
 
2
 
 
3
import com.sun.org.apache.xml.internal.serialize.*;
 
4
import org.jdom.*;
 
5
import org.jdom.Document;
 
6
import org.jdom.output.*;
 
7
import org.w3c.dom.*;
 
8
 
 
9
import javax.xml.parsers.ParserConfigurationException;
 
10
import java.io.IOException;
 
11
import java.io.File;
 
12
 
 
13
/**
 
14
 * Vladimir Nikic
 
15
 * Date: Apr 13, 2007
 
16
 */
 
17
public class Working {
 
18
 
 
19
    public static void main(String[] args) throws IOException, XPatherException, ParserConfigurationException {
 
20
        String html = "<script src=\"a\" type=\"text/javascript\" /><script src=\"b\" type=\"text/javascript\"/>";
 
21
        final HtmlCleaner cleaner = new HtmlCleaner();
 
22
        final CleanerProperties props = cleaner.getProperties();
 
23
 
 
24
//        final String resources[] = {
 
25
//                "http://www.b92.net",
 
26
//                "http://www.nba.com",
 
27
//                "http://www.naslovi.net/",
 
28
//                "http://www.theserverside.com/",
 
29
//                "http://www.yahoo.com",
 
30
//        };
 
31
//        final String resources[] = {
 
32
//                "c:/temp/htmlcleanertest/1.htm",
 
33
//                "c:/temp/htmlcleanertest/2.htm",
 
34
//                "c:/temp/htmlcleanertest/3.htm",
 
35
//                "c:/temp/htmlcleanertest/4.htm",
 
36
//                "c:/temp/htmlcleanertest/5.htm",
 
37
//        };
 
38
 
 
39
        props.setTransResCharsToNCR(false);
 
40
//        props.setIgnoreQuestAndExclam(true);
 
41
        props.setUseCdataForScriptAndStyle(false);
 
42
        props.setRecognizeUnicodeChars(true);
 
43
        props.setTranslateSpecialEntities(true);
 
44
        props.setTransSpecialEntitiesToNCR(false);
 
45
        props.setUseEmptyElementTags(false);
 
46
        props.setOmitXmlDeclaration(true);
 
47
        props.setOmitDoctypeDeclaration(false);
 
48
        props.setNamespacesAware(true);
 
49
 
 
50
        long start = System.currentTimeMillis();
 
51
        TagNode node = cleaner.clean(new File("c:/temp/htmlcleanertest/b92.htm"), "UTF-8");
 
52
        System.out.println("Cleanup time: " + (System.currentTimeMillis() - start));
 
53
    }
 
54
 
 
55
}
 
 
b'\\ No newline at end of file'