import java.lang.Integer;
import java.io.*;
import java.util.*;
import org.w3c.dom.*;
import org.w3c.dom.html.*;
import org.openxml.*;
import org.openxml.parser.*;
class TestParser {
public static void main (String args[]) throws IOException {
//Document aDoc = new Document();
//URL aURL = null;
//InputStream s;
String initialText = "\n" +
"
\n" +
"Color and font test:\n" +
"\n" +
"- red\n" +
"
- blue\n" +
"
- green\n" +
"
- small\n" +
"
- large\n" +
"
- italic\n" +
"
- bold\n" +
"
\n" +
"\n" +
"\n";
String s = null;
try {
s = "file:"
+ System.getProperty("user.dir")
+ System.getProperty("file.separator")
+ "Hello.html";
} catch (Exception e) {
System.err.println("Couldn't create a URL: " + s);
}
//File inputFile = new File("Hello.html");
//FileInputStream in = new FileInputStream(inputFile);
StringReader aReader = new StringReader(initialText);
HTMLParser aParser = new HTMLParser(aReader, s);
HTMLDocument aDoc = (HTMLDocument)aParser.parseDocument();
//in.close();
System.out.println("HTMLParser is constructed.\n");
//aDoc.setTitle("Test");
System.out.println("URL: " + aDoc.getURL() + "\n");
System.out.println(aDoc.getDocumentElement().getFirstChild().getNodeName() + "\n");
System.out.println(aDoc.getDocumentElement().getFirstChild().getNodeValue() + "\n");
}
}