Transformer transformer = factory.newTransformer();
transformer.transform(source, domResult);
result.addVariable(new NodeVariable(out.toByteArray()));
} catch (TransformerException e) {
log.error(transformError, e);
throw new PluginException(e);
} catch (IllegalAccessException e) {
throw new PluginException(e);
} catch (InstantiationException e) {
throw new PluginException(e);
} catch (Exception e) {
if (e instanceof SAXException) {
String msg = "Error parsing content retrieved from the url" + documentURI;
log.error(msg, e);
throw new PluginException(msg, e);
} else if(e instanceof IOException) {
String msg = "Error retrieving content from the url" + documentURI;
log.error(msg, e);
throw new PluginException(msg, e);
} else if(e instanceof ClassNotFoundException) {
log.error(EXCEPTION, e);
throw new PluginException(EXCEPTION, e);
} else if(e instanceof InvocationTargetException) {
log.error(EXCEPTION, e);
throw new PluginException(EXCEPTION, e);
} else if(e instanceof IllegalAccessException) {
log.error(EXCEPTION, e);
throw new PluginException(EXCEPTION, e);
} else {
String msg = "Error occurred with the content of " + documentURI;
log.error(msg, e);
throw new PluginException(msg, e);
}
}
}
} catch (ClassNotFoundException e) {
log.error(EXCEPTION, e);
throw new PluginException(EXCEPTION, e);
} catch (InstantiationException e) {
log.error(EXCEPTION, e);
throw new PluginException(EXCEPTION, e);
} catch (IllegalAccessException e) {
log.error(EXCEPTION, e);
throw new PluginException(EXCEPTION, e);
} catch (NoSuchMethodException e) {
log.error(EXCEPTION, e);
throw new PluginException(EXCEPTION, e);
} catch (InvocationTargetException e) {
log.error(EXCEPTION, e);
throw new PluginException(EXCEPTION, e);
}
} else {
result.addVariable(new NodeVariable(elementDef.getBodyText()));
}