I have to convert a GML-Server Response to a GPX-File with jdom in Java So far the Get-Feature-Request i send to the server is correct and gives me a GML-File as response, but when i want to print the file it says [#document: null]
The output on console:
[#document: null]
try {
//zu Funktionstestzwecken - löschen wenn nicht mehr benötigt
String typename = gui.ConverterDialog.tfconverter.getText();
String urlString = gui.UrlDialog.txturlinput.getText() + "?service=WFS&version=1.0.0&REQUEST=GetFeature&typename=" + typename;
//entfernen wenn nicht mehr benötigt
System.out.println("url "+ urlString);
URL url = new URL(urlString);
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(url.openStream());
//doc.getDocumentElement().normalize();
//entfernen wenn nicht mehr benötigt
//doc null ???
System.out.println(doc);
} catch(Exception e) {
String errorMessage = "An error occured:" + e;
System.err.println(errorMessage);
e.printStackTrace();
}