private DomParser getDomParser(String source, final MessageQueue mq) throws ParseException {
InputSource is = getInputSource();
HtmlLexer lexer = new HtmlLexer(CharProducer.Factory.fromString(source, is));
final Namespaces ns = Namespaces.HTML_DEFAULT; // Includes OpenSocial
final boolean needsDebugData = needsDebugData();
DomParser parser = new DomParser(lexer, is, ns, mq);
parser.setDomImpl(documentFactory);
parser.setWantsComments(true);
parser.setNeedsDebugData(needsDebugData);
return parser;
}