public Document parse()

in src/main/java/org/apache/sling/commons/html/internal/TagsoupHtmlParser.java [97:114]


    public Document parse(String systemId, InputStream stream, String encoding) throws IOException {
        final DOMBuilder builder = new DOMBuilder();

        final InputSource source = new InputSource(stream);
        source.setEncoding(encoding);
        source.setSystemId(systemId);

        try {
            final Parser parser = buildParser(features, builder);
            parser.parse(source);
        } catch (SAXException se) {
            if (se.getCause() instanceof IOException) {
                throw (IOException) se.getCause();
            }
            throw new IOException("Unable to parse HTML", se);
        }
        return builder.getDocument();
    }