Java XML Document Parse parseHTMLDocument(String paramString)

Here you can find the source of parseHTMLDocument(String paramString)

Description

parse HTML Document

License

Open Source License

Declaration

static HTMLDocument parseHTMLDocument(String paramString) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;

import java.io.StringReader;

import javax.swing.text.BadLocationException;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;

public class Main {
    static HTMLDocument parseHTMLDocument(String paramString) {
        StringReader localStringReader = new StringReader(paramString);
        HTMLEditorKit localHTMLEditorKit = new HTMLEditorKit();
        HTMLDocument localHTMLDocument = (HTMLDocument) localHTMLEditorKit
                .createDefaultDocument();
        localHTMLDocument.putProperty("IgnoreCharsetDirective",
                Boolean.TRUE);/*from   w  ww . ja  v a 2s  . c o  m*/
        try {
            localHTMLEditorKit
                    .read(localStringReader, localHTMLDocument, 0);
        } catch (IOException localIOException) {
            System.out.println(localIOException);
            localIOException.printStackTrace();
            return null;
        } catch (BadLocationException localBadLocationException) {
            System.out.println(localBadLocationException);
            localBadLocationException.printStackTrace();
            return null;
        }
        return localHTMLDocument;
    }
}

Related

  1. parseDocument(String path)
  2. parseDocument(String xmlString)
  3. parseDocumentIntoStringXML(Document document)
  4. parseDocumentr(File f)
  5. parseFileToDocument(File f)
  6. parseInitMap(InputStream in, DocumentBuilder builder, Map> initMap)
  7. parseMultipleWorkouts(Document doc)
  8. parseResponse(InputSource is, DocumentBuilder documentBuilder)
  9. parseToDocument(InputStream is, boolean debugModeEnabled)