public void parse(InputSource is, ContentHandler consumer)
throws IOException, SAXException {
if (is == null)
throw new NullPointerException("is argument is required.");
SAXParser parser = new SAXParser();
parser.setFeature("http://xml.org/sax/features/namespaces", true);
parser
.setFeature(
"http://cyberneko.org/html/features/override-namespaces",
false);
parser.setFeature(
"http://cyberneko.org/html/features/insert-namespaces", false);
parser
.setFeature(
"http://cyberneko.org/html/features/scanner/ignore-specified-charset",
true);
parser.setProperty(
"http://cyberneko.org/html/properties/default-encoding",
"UTF-8");
parser.setProperty("http://cyberneko.org/html/properties/names/elems",
"lower");
parser.setProperty("http://cyberneko.org/html/properties/names/attrs",
"lower");
parser.setContentHandler(new RemoveNamespacesHandler(
new MergeCharacterEventsHandler(consumer)));
parser.parse(is);
}