+ /**
+ * Gets a dom level 3 implementation.
+ * @return Dom implementation.
+ * @throws ClassNotFoundException
+ * @throws InstantiationException
+ * @throws IllegalAccessException
+ */
+ public static DOMImplementationLS getDomImplementationLS() {
+ final String message = "Could not get Dom level 3 implementation";
+ try {
+ DOMImplementationRegistry registry = DOMImplementationRegistry
+ .newInstance();
+
+ DOMImplementationLS impl = (DOMImplementationLS) registry
+ .getDOMImplementation("LS");
+ return impl;
+ } catch (ClassCastException e) {
+ throw new RuntimeException(message, e);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(message, e);
+ } catch (InstantiationException e) {
+ throw new RuntimeException(message, e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(message, e);
+ }
+ }
+