use of org.jdom2.input.sax.XMLReaderJDOMFactory in project archi by archimatetool.
the class JDOMUtils method readXMLFile.
/**
* Reads and returns a JDOM Document from file with Schema validation
* @param xmlFile The XML File
* @param schemaFile One or more Schema files
* @return The JDOM Document or null if not found
* @throws JDOMException
* @throws IOException
*/
public static Document readXMLFile(File xmlFile, File... schemaFiles) throws IOException, JDOMException {
XMLReaderJDOMFactory factory = new XMLReaderXSDFactory(schemaFiles);
SAXBuilder builder = new SAXBuilder(factory);
// This allows UNC mapped locations to load
return builder.build(new FileInputStream(xmlFile));
}
Aggregations