Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
SAXBuilder builder = new SAXBuilder(
"org.apache.xerces.parsers.SAXParser", true); // Überprüft die Wohlgeformtheit
builder.setFeature("http://apache.org/xml/features/validation/schema", true ); //Aktiviere Schema-Validation
builder.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",
new File("XSD-Datei").getAbsolutePath());
try {
InputStream in = this.getClass().getResourceAsStream("Umfrage.xml");
InputSource src = new InputSource(in);
Document doc = builder.build(src);
} catch (JDOMException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
JA UND?BRT006 hat gesagt.:Bedauerlicherweise kann ich Xerces nicht in das Projekt importieren, muss das also irgendwie anders realisieren, den von dir geposteten Ausschnitt hab ich schon gesehen. Außerdem wäre dann noch die Frage offen nach dem DTD.
SAXParserFactory.newInstance().newSAXParser()