*/
private void parseXMLMetadata(InputStream stream) {
Element[] meta = null;
try {
XMLReader parser = XMLReaderFactory.createXMLReader();
XMLMetadataParser handler = new XMLMetadataParser();
parser.setContentHandler(handler);
parser.setFeature("http://xml.org/sax/features/validation",
true);
parser.setFeature("http://apache.org/xml/features/validation/schema",
true);
parser.setErrorHandler(handler);
if (! m_ignoreLocalXSD) {
parser.setEntityResolver(new SchemaResolver());
}
InputSource is = new InputSource(stream);
parser.parse(is);
meta = handler.getMetadata();
stream.close();
} catch (IOException e) {
error("Cannot open the metadata input stream: " + e.getMessage());
} catch (ParseException e) {