private static Document loadHTML ( InputSource source , boolean useNamespace ) throws SAXException , IOException { DOMParser parser = new DOMParser ( ) ; // source http://nekohtml.sourceforge.net/faq.html#hierarchy parser . setFeature ( FEAT_NAMESPACES , useNamespace ) ; parser . parse ( source ) ; return new DocumentImpl ( parser . getDocument ( ) ) ; }
Helper for loading HTML document from input source .