# How to use ACTF HTML Parser

## 1. Preparation

- Add org.eclipse.actf.mode.dom.html as required plug-in
  by using Dependencies tab or
  by editing MANIFEST.MF directory
- In the case of usual Java project, add jar file (org.eclipse.actf.model.dom.html_*.jar) into build path.

## 2. Usage

1. Create HTML Parser

       IHTMLParser parser = HTMLParserFactory.createHTMLParser();

2. Parse target HTML as InputStream

   - Parse HTML by using default encoding

         parser.parse(InputStream is);

   - Parse HTML by using specified encoding

         parser.parse(InputStream is, String encoding);

   - Parse HTML by using charset information in META tag

         parser.parseSwitchEnc(*);

3. Obtain resulting HTML Document

       Document doc = parser.getDocument();

The resulting HTML Document implements org.w3c.dom.html Interface.
(See API document for more details.)

# Additional resources

In org.eclipse.actf.core plugin, several DOM utilities are available

org.eclipse.actf.util.dom.DomPrintUtil | Utility to convert DOM into String
org.eclipse.actf.util.dom.NodeIteratorImpl | DOM NodeIterator implementation
org.eclipse.actf.util.dom.TreeWalkerImpl | DOM TreeWalker implementation
org.eclipse.actf.util.xpath.XPathService | Utility for XPath evaluation (Instance can be obtained from XPathServiceFactory)