boolean es53, boolean debug) {
URI javaUri = uri.toJavaUri();
InputSource is = new InputSource(javaUri);
MessageQueue mq = new SimpleMessageQueue();
try {
UriFetcher fetcher = makeFetcher(uri, container);
ExternalReference extRef = new ExternalReference(javaUri,
FilePosition.instance(is, /*lineNo*/ 1, /*charInFile*/ 1, /*charInLine*/ 1));
// If the fetch fails, a UriFetchException is thrown and serialized as part of the
// message queue.
CharProducer cp = fetcher.fetch(extRef, mime).getTextualContent();
ParseTreeNode ptn = parse(is, cp, mime, mq);
return rewrite(uri, container, ptn, es53, debug);
} catch (UnsupportedEncodingException e) {
LOG.severe("Unexpected inability to recognize mime type: " + mime);
mq.addMessage(ServiceMessageType.UNEXPECTED_INPUT_MIME_TYPE,