use of org.jdom.input.SAXBuilder in project beast-mcmc by beast-dev.
the class AbstractPolygon2D method readKMLFile.
public static List<AbstractPolygon2D> readKMLFile(String fileName) {
List<AbstractPolygon2D> polygons = new ArrayList<AbstractPolygon2D>();
try {
SAXBuilder builder = new SAXBuilder();
builder.setValidation(false);
builder.setIgnoringElementContentWhitespace(true);
Document doc = builder.build(new File(fileName));
Element root = doc.getRootElement();
if (!root.getName().equalsIgnoreCase("KML"))
throw new RuntimeException("Not a KML file");
readKMLElement(root, polygons);
} catch (IOException e) {
e.printStackTrace();
} catch (JDOMException e) {
e.printStackTrace();
}
return polygons;
}
use of org.jdom.input.SAXBuilder in project beast-mcmc by beast-dev.
the class XMLModelFile method main.
public static void main(String[] args) {
//main method for debugging
SAXBuilder parser = new SAXBuilder();
Document doc;
try {
doc = parser.build(new File("testSimplePathSampling.xml"));
XMLModelFile z = new XMLModelFile(doc.getRootElement());
z.printIdentified();
HashMap<String, String> hm = new HashMap<String, String>();
hm.put("samplingMean", "samplingMean");
z.prefixIdentifiedNames("model1.", hm, false);
z.printIdentified();
} catch (IOException e) {
//
} catch (JDOMException e) {
//
}
}
Aggregations