XMLFileLoader.java
526 Bytes
package osp.utils;
import java.io.File;
import org.jdom.Document;
import org.jdom.input.SAXBuilder;
public class XMLFileLoader {
public static Document getDocument(String fileName) {
try {
return new SAXBuilder().build(new File(fileName));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public static Document getDocument(File file) {
try {
return new SAXBuilder().build(file);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}