Code example for XMLReader

Methods: parsesetContentHandler

   private static XMLReader PARSER;
   public static Document parse(String html) throws SAXException, IOException {
      XMLReader saxReader = getParser();
      GwtXmlContentHandler contentHandler = new GwtXmlContentHandler();
      saxReader.parse(new InputSource(new StringReader(html)));
      return contentHandler.getParsedDocument();
   private static XMLReader getParser() {
      if (PARSER == null) {
         PARSER = XmlUtils.newXMLReader();
      return PARSER;
Connect your IDE to all the code out there  Get Codota for Java