InputSource source = new InputSource(beansXmlInputStream);
if (source.getByteStream().available() == 0) {
// The file is just acting as a marker file
return EMPTY_BEANS_XML;
}
BeansXmlHandler handler = new BeansXmlHandler(beansXml);
try {
parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", loadXsds());
} catch (SAXNotRecognizedException e) {
// No op, we just don't validate the XML
} catch (SAXNotSupportedException e) {
// No op, we just don't validate the XML
}
parser.parse(source, handler);
return handler.createBeansXml();
} catch (IOException e) {
throw new DeploymentUnitProcessingException("IOException parsing " + beansXml,e);
} catch (SAXException e) {
throw new DeploymentUnitProcessingException("SAXException parsing " + beansXml,e);
} finally {