}
}
// Get the references to the actual DOM and DTD handler
final DOMImpl dom = doc.getDocument();
final DTDMonitor dtd = doc.getDTDMonitor();
// The dom reference may be null if the URL pointed to a
// non-existing document
if (dom == null) return null;
doc.incAccessCount(); // For statistics
final AbstractTranslet translet = (AbstractTranslet)trs;
// Set minimum needed size for key/id indices in the translet
translet.setIndexSize(dom.getSize());
// Create index for any ID attributes defined in the document DTD
dtd.buildIdIndex(dom, mask, translet);
// Pass all unparsed entities to the translet
translet.setUnparsedEntityURIs(dtd.getUnparsedEntityURIs());