// bug261072: clone the project since readObjectPersistenceRuntimeFormat will change its datasourceLogin and Classloader
return readObjectPersistenceRuntimeFormat(document, classLoader, (Project)project.clone());
}
private static XMLParser createXMLParser(XMLPlatform xmlPlatform, boolean namespaceAware, boolean whitespacePreserving, String schema){
XMLParser parser = xmlPlatform.newXMLParser();
parser.setNamespaceAware(namespaceAware);
parser.setWhitespacePreserving(whitespacePreserving);
if (schema != null) {
parser.setValidationMode(XMLParser.SCHEMA_VALIDATION);
// Workaround for bug #3503583.
XMLSchemaResolver xmlSchemaResolver = new XMLSchemaResolver();
URL eclipselinkSchemaURL = xmlSchemaResolver.resolveURL(schema);
parser.setEntityResolver(xmlSchemaResolver);
parser.setXMLSchema(eclipselinkSchemaURL);
}
return parser;
}