DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
- if(schemaURL != null) {
+ if(schemaURL != null && validateAgainstSchema()) {
factory.setValidating(true);
factory.setAttribute(
}
}
-
- public void initialize(BundleContext context) {
+
+ private boolean validateAgainstSchema() {
+ return Platform.inDevelopmentMode();
+ }
+
+ public void initialize(BundleContext context) {
try {
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
- factory.setValidating(true);
- factory.setAttribute(
- "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
- "http://www.w3.org/2001/XMLSchema");
- factory.setAttribute(
- "http://java.sun.com/xml/jaxp/properties/schemaSource",
- context.getBundle().getResource("adapters.xsd").toString());
+
+ if (validateAgainstSchema()) {
+ factory.setValidating(true);
+ factory.setAttribute(
+ "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
+ "http://www.w3.org/2001/XMLSchema");
+ factory.setAttribute(
+ "http://java.sun.com/xml/jaxp/properties/schemaSource",
+ context.getBundle().getResource("adapters.xsd").toString());
+ }
// TODO Listen bundles (install/uninstall)
if (exceptions.isEmpty())