CSSResolver cssResolver = workerHelper.getDefaultCssResolver(true);
Pipeline<?> pipeline = new CssResolverPipeline(cssResolver, htmlPipeline);
XMLWorker worker = new XMLWorker(pipeline, true);
XMLParser parser = new XMLParser(worker);
if (source instanceof InputStream) {
parser.parse((InputStream) source, cCharset);
} else if (source instanceof Reader) {
parser.parse((Reader) source);
} else {
StringReader reader = new StringReader((String) source);
parser.parse(reader);
}
document.close();
return new DocumentOutput(new ByteArrayInputStream(outputStream.toByteArray()));