* Bug #14418 fixed - saxon9he.jar made scilab throw an XPathFactoryConfigurationExcep... 26/17826/4
Clément DAVID [Mon, 29 Feb 2016 16:46:23 +0000 (17:46 +0100)]
Change-Id: Ia69696ee0660954729629cd3e92c2f79da3895d4

scilab/CHANGES
scilab/modules/commons/src/java/org/scilab/modules/commons/xml/ScilabXPathFactory.java

index dc69bda..8d0a241 100644 (file)
@@ -355,6 +355,8 @@ In 6.0.0:
 
 * Bug #14416 fixed - The file extension filter in Scinotes "Save as" window did not re-used the active file's extension when applicable.
 
+* Bug #14418 fixed - saxon9he.jar made scilab throw an XPathFactoryConfigurationException.
+
 * Bug #14423 fixed - bench_run did not have a return value, export file was not configurable
 
 * Bug #14425 fixed - xpause() was a duplicate of sleep(). sleep() did not propose "s" time unit.
index 72cac2f..ff70c09 100644 (file)
@@ -16,6 +16,7 @@
 package org.scilab.modules.commons.xml;
 
 import javax.xml.xpath.XPathFactory;
+import javax.xml.xpath.XPathFactoryConfigurationException;
 
 /**
  * Class to provide a way to be sure that the default PathFactory provided by Java framework will be used.
@@ -32,7 +33,6 @@ public class ScilabXPathFactory {
     public static String useDefaultTransformerFactoryImpl() {
         String factory = System.getProperty(XPATHFACTORYPROPERTY);
         System.setProperty(XPATHFACTORYPROPERTY, XPATHFACTORYIMPL);
-
         return factory;
     }
 
@@ -53,9 +53,14 @@ public class ScilabXPathFactory {
      */
     public static XPathFactory newInstance() {
         String factory = useDefaultTransformerFactoryImpl();
-        XPathFactory xpf = XPathFactory.newInstance();
+        XPathFactory xpf;
+        try {
+            xpf = XPathFactory.newInstance(XPathFactory.DEFAULT_OBJECT_MODEL_URI, XPATHFACTORYIMPL, ScilabXPathFactory.class.getClassLoader());
+        } catch (XPathFactoryConfigurationException e) {
+            e.printStackTrace();
+            return XPathFactory.newInstance();
+        }
         restoreTransformerFactoryImpl(factory);
-
         return xpf;
     }
 }