Hello everyone,
everytime i try to access an XML File i get the following error output:
[Fatal Error] :-1:-1: Premature end of file.
org.xml.sax.SAXParseException: Premature end of file.
The XML file looks like this:
<?xml version="1.0" encoding="UTF-8"?><Rezept><Name>test<Kochbuch>test</Kochbuch><Seite>23</Seite><Zutaten><Zutat Menge="2">eier</Zutat></Zutaten><Anleitung>Geben Sie hier das Rezept ein</Anleitung></Name></Rezept>
Well, it's German but maybe you could tell me whats wrong with that. The code that tries to access the XML file is the following:
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
doc = builder.parse(file);
} catch (ParserConfigurationException e) {
new ExceptionFrame(e.toString());
} catch(SAXException ex) {
ex.printStackTrace();
} catch(IOException ex) {
ex.printStackTrace();
}
This is only called - and it only happens - when the file exists.
So, like usual, i am very happy for any advice that lead me to the right direction and to make me see the light :-)
Chris