private void createDocReader(File localFile, CROM dtdRoot) throws IOException {
if (m_DocReader != null) {
m_DocReader.close();
}
if (isXml() || isJson()) {
XmlReader xmlReader = new XmlReader(localFile, dtdRoot);
if (isJson()) {
xmlReader.useForJson();
}
m_DocReader = xmlReader;
} else {
m_DocReader = new TextDocReader(localFile, m_flat, dtdRoot);
}