changeset 917:d0f44ce2320f

Merge
author asaha
date Tue, 11 Feb 2014 15:40:12 -0800
parents 72d24ef24ae1 086dca834645
children 0c95daa3a49c
files .hgtags src/com/sun/org/apache/xalan/internal/XalanConstants.java src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java
diffstat 64 files changed, 869 insertions(+), 548 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Tue Feb 11 15:12:01 2014 -0800
+++ b/.hgtags	Tue Feb 11 15:40:12 2014 -0800
@@ -359,6 +359,7 @@
 66363323f14d85d4ab28e883a3323b9d72dea5fd jdk7u40-b42
 c0bd71414ea513f54f23965936a837fca093ac91 jdk7u40-b43
 91bc4534851265291bb3b16452a0968d6909979f jdk7u40-b60
+d9b92749a0f4c8e6c6f4fe11210c2a02d70bae74 jdk7u60-b00
 c500d4ec41ff2117eabfa33e640b6df2f21deb3d jdk7u40-b61
 9e3f8ab9d17be6b1a4a097fcc5bc5412013d3e86 jdk7u40-b62
 1a7e2024963d3a8d6cde209de0967ac43418b82a jdk7u45-b01
@@ -409,3 +410,10 @@
 5592b0c44617022e3c136eedfa1e98d4f254c964 jdk7u55-b05
 c59d714090080ad2e06f0ca5e8d354403059d8ce jdk7u55-b06
 125ea54089add3a16898b801a9989bf6cca05da6 jdk7u55-b07
+39337c00cb3ce29b4d67f6d247c3fa80f16cb49f jdk7u55-b08
+d9b92749a0f4c8e6c6f4fe11210c2a02d70bae74 jdk7u60-b00
+ad39e88c503948fc4fc01e97c75b6e3c24599d23 jdk7u60-b01
+050986fd54e3ec4515032ee938bc59e86772b6c0 jdk7u60-b02
+359b79d99538d17eeb90927a1e4883fcec31661f jdk7u60-b03
+7215972c2c30d0fa469a459a3e4fcee6bc93991d jdk7u60-b04
+673ea3822e59de18ae5771de7a280c6ae435ef86 jdk7u60-b05
--- a/src/com/sun/org/apache/xalan/internal/XalanConstants.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/XalanConstants.java	Tue Feb 11 15:40:12 2014 -0800
@@ -200,6 +200,19 @@
             ORACLE_JAXP_PROPERTY_PREFIX + "xmlSecurityPropertyManager";
 
     /**
+     * Feature enableExtensionFunctions
+     */
+    public static final String ORACLE_ENABLE_EXTENSION_FUNCTION =
+            ORACLE_JAXP_PROPERTY_PREFIX + "enableExtensionFunctions";
+    public static final String SP_ORACLE_ENABLE_EXTENSION_FUNCTION = "javax.xml.enableExtensionFunctions";
+
+    /**
+     * Values for a feature
+     */
+    public static final String FEATURE_TRUE = "true";
+    public static final String FEATURE_FALSE = "false";
+
+    /**
      * Check if we're in jdk8 or above
      */
     public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8);
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java	Tue Feb 11 15:40:12 2014 -0800
@@ -472,7 +472,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1413,13 +1419,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- a/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java	Tue Feb 11 15:40:12 2014 -0800
@@ -471,7 +471,13 @@
 
   // Error messages...
 
-  private static final Object[][] _contents = new Object[][] {
+  /** Get the lookup table for error messages.
+    *
+    * @return The message lookup table.
+    */
+  public Object[][] getContents()
+  {
+      return new Object[][] {
 
   /** Error message ID that has a null message, but takes in a single object.    */
   {"ER0000" , "{0}" },
@@ -1412,13 +1418,6 @@
 
   };
 
-  /** Get the lookup table for error messages.
-   *
-   * @return The int to message lookup table.
-   */
-  public Object[][] getContents()
-  {
-      return _contents;
   }
   // ================= INFRASTRUCTURE ======================
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/sun/org/apache/xalan/internal/utils/FeatureManager.java	Tue Feb 11 15:40:12 2014 -0800
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.org.apache.xalan.internal.utils;
+
+
+import com.sun.org.apache.xalan.internal.XalanConstants;
+
+/**
+ * This class manages security related properties
+ *
+ */
+public final class FeatureManager extends FeaturePropertyBase {
+
+    /**
+     * States of the settings of a property, in the order: default value, value
+     * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
+     * properties, and jaxp api properties
+     */
+    public static enum State {
+        //this order reflects the overriding order
+        DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
+    }
+
+    /**
+     * Xalan Features
+     */
+    public static enum Feature {
+        ORACLE_ENABLE_EXTENSION_FUNCTION(XalanConstants.ORACLE_ENABLE_EXTENSION_FUNCTION,
+                "true");
+
+        final String name;
+        final String defaultValue;
+
+        Feature(String name, String value) {
+            this.name = name;
+            this.defaultValue = value;
+        }
+
+        public boolean equalsName(String propertyName) {
+            return (propertyName == null) ? false : name.equals(propertyName);
+        }
+
+        String defaultValue() {
+            return defaultValue;
+        }
+    }
+
+    /**
+     * Default constructor. Establishes default values
+     */
+    public FeatureManager() {
+        values = new String[Feature.values().length];
+        for (Feature feature : Feature.values()) {
+            values[feature.ordinal()] = feature.defaultValue();
+        }
+        //read system properties or jaxp.properties
+        readSystemProperties();
+    }
+
+
+    /**
+     * Check if the feature is enabled
+     * @param feature name of the feature
+     * @return true if enabled, false otherwise
+     */
+    public boolean isFeatureEnabled(Feature feature) {
+        return Boolean.parseBoolean(values[feature.ordinal()]);
+    }
+
+    /**
+     * Check if the feature is enabled
+     * @param propertyName name of the feature
+     * @return true if enabled, false otherwise
+     */
+    public boolean isFeatureEnabled(String propertyName) {
+        return Boolean.parseBoolean(values[getIndex(propertyName)]);
+    }
+
+    /**
+     * Get the index by property name
+     * @param propertyName property name
+     * @return the index of the property if found; return -1 if not
+     */
+    public int getIndex(String propertyName){
+        for (Feature feature : Feature.values()) {
+            if (feature.equalsName(propertyName)) {
+                return feature.ordinal();
+            }
+        }
+        return -1;
+    }
+
+    /**
+     * Read from system properties, or those in jaxp.properties
+     */
+    private void readSystemProperties() {
+        getSystemProperty(Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
+                XalanConstants.SP_ORACLE_ENABLE_EXTENSION_FUNCTION);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/com/sun/org/apache/xalan/internal/utils/FeaturePropertyBase.java	Tue Feb 11 15:40:12 2014 -0800
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.org.apache.xalan.internal.utils;
+
+import com.sun.org.apache.xalan.internal.XalanConstants;
+
+/**
+ * This is the base class for features and properties
+ *
+ */
+public abstract class FeaturePropertyBase {
+
+    /**
+     * States of the settings of a property, in the order: default value, value
+     * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
+     * properties, and jaxp api properties
+     */
+    public static enum State {
+        //this order reflects the overriding order
+        DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
+    }
+
+
+    /**
+     * Values of the properties as defined in enum Properties
+     */
+    String[] values = null;
+    /**
+     * States of the settings for each property in Properties above
+     */
+    State[] states = {State.DEFAULT, State.DEFAULT};
+
+
+    /**
+     * Set the value for a specific property.
+     *
+     * @param property the property
+     * @param state the state of the property
+     * @param value the value of the property
+     */
+    public void setValue(Enum property, State state, String value) {
+        //only update if it shall override
+        if (state.compareTo(states[property.ordinal()]) >= 0) {
+            values[property.ordinal()] = value;
+            states[property.ordinal()] = state;
+        }
+    }
+
+    /**
+     * Set the value of a property by its index
+     * @param index the index of the property
+     * @param state the state of the property
+     * @param value the value of the property
+     */
+    public void setValue(int index, State state, String value) {
+        //only update if it shall override
+        if (state.compareTo(states[index]) >= 0) {
+            values[index] = value;
+            states[index] = state;
+        }
+    }
+
+     /**
+     * Set value by property name and state
+     * @param propertyName property name
+     * @param state the state of the property
+     * @param value the value of the property
+     * @return true if the property is managed by the security property manager;
+     *         false if otherwise.
+     */
+    public boolean setValue(String propertyName, State state, Object value) {
+        int index = getIndex(propertyName);
+        if (index > -1) {
+            setValue(index, state, (String)value);
+            return true;
+        }
+        return false;
+    }
+
+     /**
+     * Set value by property name and state
+     * @param propertyName property name
+     * @param state the state of the property
+     * @param value the value of the property
+     * @return true if the property is managed by the security property manager;
+     *         false if otherwise.
+     */
+    public boolean setValue(String propertyName, State state, boolean value) {
+        int index = getIndex(propertyName);
+        if (index > -1) {
+            if (value) {
+                setValue(index, state, XalanConstants.FEATURE_TRUE);
+            } else {
+                setValue(index, state, XalanConstants.FEATURE_FALSE);
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Return the value of the specified property
+     *
+     * @param property the property
+     * @return the value of the property
+     */
+    public String getValue(Enum property) {
+        return values[property.ordinal()];
+    }
+
+    /**
+     * Return the value of the specified property
+     *
+     * @param property the property
+     * @return the value of the property
+     */
+    public String getValue(String property) {
+        int index = getIndex(property);
+        if (index > -1) {
+            return getValueByIndex(index);
+        }
+        return null;
+    }
+
+    /**
+     * Return the value of the specified property.
+     *
+     * @param propertyName the property name
+     * @return the value of the property as a string. If a property is managed
+     * by this manager, its value shall not be null.
+     */
+    public String getValueAsString(String propertyName) {
+        int index = getIndex(propertyName);
+        if (index > -1) {
+            return getValueByIndex(index);
+        }
+
+        return null;
+    }
+
+    /**
+     * Return the value of a property by its ordinal
+     * @param index the index of a property
+     * @return value of a property
+     */
+    public String getValueByIndex(int index) {
+        return values[index];
+    }
+
+    /**
+     * Get the index by property name
+     * @param propertyName property name
+     * @return the index of the property if found; return -1 if not
+     */
+    public abstract int getIndex(String propertyName);
+
+    public <E extends Enum<E>> int getIndex(Class<E> property, String propertyName) {
+        for (Enum<E> enumItem : property.getEnumConstants()) {
+            if (enumItem.toString().equals(propertyName)) {
+                //internally, ordinal is used as index
+                return enumItem.ordinal();
+            }
+        }
+        return -1;
+    };
+
+
+    /**
+     * Read from system properties, or those in jaxp.properties
+     *
+     * @param property the property
+     * @param systemProperty the name of the system property
+     */
+    void getSystemProperty(Enum property, String systemProperty) {
+        try {
+            String value = SecuritySupport.getSystemProperty(systemProperty);
+            if (value != null) {
+                values[property.ordinal()] = value;
+                states[property.ordinal()] = State.SYSTEMPROPERTY;
+                return;
+            }
+
+            value = SecuritySupport.readJAXPProperty(systemProperty);
+            if (value != null) {
+                values[property.ordinal()] = value;
+                states[property.ordinal()] = State.JAXPDOTPROPERTIES;
+            }
+        } catch (NumberFormatException e) {
+            //invalid setting ignored
+        }
+    }
+}
--- a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java	Tue Feb 11 15:40:12 2014 -0800
@@ -1,42 +1,28 @@
 /*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
  *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common Development
- * and Distribution License("CDDL") (collectively, the "License").  You
- * may not use this file except in compliance with the License.  You can
- * obtain a copy of the License at
- * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
- * or packager/legal/LICENSE.txt.  See the License for the specific
- * language governing permissions and limitations under the License.
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
  *
- * When distributing the software, include this License Header Notice in each
- * file and include the License file at packager/legal/LICENSE.txt.
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  *
- * GPL Classpath Exception:
- * Oracle designates this particular file as subject to the "Classpath"
- * exception as provided by Oracle in the GPL Version 2 section of the License
- * file that accompanied this code.
- *
- * Modifications:
- * If applicable, add the following below the License Header, with the fields
- * enclosed by brackets [] replaced by your own identifying information:
- * "Portions Copyright [year] [name of copyright owner]"
- *
- * Contributor(s):
- * If you wish your version of this file to be governed by only the CDDL or
- * only the GPL Version 2, indicate your decision by adding "[Contributor]
- * elects to include this software in this distribution under the [CDDL or GPL
- * Version 2] license."  If you don't indicate a single choice of license, a
- * recipient has the option to distribute your version of this file under
- * either the CDDL, the GPL Version 2 or to extend the choice of license to
- * its licensees as provided above.  However, if you add GPL Version 2 code
- * and therefore, elected the GPL Version 2 license, then the option applies
- * only if the new code is made subject to such option by the copyright
- * holder.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
  */
+
 package com.sun.org.apache.xalan.internal.utils;
 
 import com.sun.org.apache.xalan.internal.XalanConstants;
--- a/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java	Tue Feb 11 15:40:12 2014 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,20 +33,10 @@
  * This class manages security related properties
  *
  */
-public final class XMLSecurityPropertyManager {
+public final class XMLSecurityPropertyManager extends FeaturePropertyBase {
 
     /**
-     * States of the settings of a property, in the order: default value, value
-     * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system
-     * properties, and jaxp api properties
-     */
-    public static enum State {
-        //this order reflects the overriding order
-        DEFAULT, FSP, JAXPDOTPROPERTIES, SYSTEMPROPERTY, APIPROPERTY
-    }
-
-    /**
-     * Limits managed by the security manager
+     * Properties managed by the security property manager
      */
     public static enum Property {
         ACCESS_EXTERNAL_DTD(XMLConstants.ACCESS_EXTERNAL_DTD,
@@ -73,15 +63,6 @@
 
 
     /**
-     * Values of the properties as defined in enum Properties
-     */
-    private final String[] values;
-    /**
-     * States of the settings for each property in Properties above
-     */
-    private State[] states = {State.DEFAULT, State.DEFAULT};
-
-    /**
      * Default constructor. Establishes default values
      */
     public XMLSecurityPropertyManager() {
@@ -94,86 +75,6 @@
     }
 
     /**
-     * Set limit by property name and state
-     * @param propertyName property name
-     * @param state the state of the property
-     * @param value the value of the property
-     * @return true if the property is managed by the security property manager;
-     *         false if otherwise.
-     */
-    public boolean setValue(String propertyName, State state, Object value) {
-        int index = getIndex(propertyName);
-        if (index > -1) {
-            setValue(index, state, (String)value);
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Set the value for a specific property.
-     *
-     * @param property the property
-     * @param state the state of the property
-     * @param value the value of the property
-     */
-    public void setValue(Property property, State state, String value) {
-        //only update if it shall override
-        if (state.compareTo(states[property.ordinal()]) >= 0) {
-            values[property.ordinal()] = value;
-            states[property.ordinal()] = state;
-        }
-    }
-
-    /**
-     * Set the value of a property by its index
-     * @param index the index of the property
-     * @param state the state of the property
-     * @param value the value of the property
-     */
-    public void setValue(int index, State state, String value) {
-        //only update if it shall override
-        if (state.compareTo(states[index]) >= 0) {
-            values[index] = value;
-            states[index] = state;
-        }
-    }
-
-    /**
-     * Return the value of the specified property
-     *
-     * @param propertyName the property name
-     * @return the value of the property as a string
-     */
-    public String getValue(String propertyName) {
-        int index = getIndex(propertyName);
-        if (index > -1) {
-            return getValueByIndex(index);
-        }
-
-        return null;
-    }
-
-    /**
-     * Return the value of the specified property
-     *
-     * @param property the property
-     * @return the value of the property
-     */
-    public String getValue(Property property) {
-        return values[property.ordinal()];
-    }
-
-    /**
-     * Return the value of a property by its ordinal
-     * @param index the index of a property
-     * @return value of a property
-     */
-    public String getValueByIndex(int index) {
-        return values[index];
-    }
-
-    /**
      * Get the index by property name
      * @param propertyName property name
      * @return the index of the property if found; return -1 if not
@@ -198,28 +99,4 @@
                 XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET);
     }
 
-    /**
-     * Read from system properties, or those in jaxp.properties
-     *
-     * @param property the property
-     * @param systemProperty the name of the system property
-     */
-    private void getSystemProperty(Property property, String systemProperty) {
-        try {
-            String value = SecuritySupport.getSystemProperty(systemProperty);
-            if (value != null) {
-                values[property.ordinal()] = value;
-                states[property.ordinal()] = State.SYSTEMPROPERTY;
-                return;
-            }
-
-            value = SecuritySupport.readJAXPProperty(systemProperty);
-            if (value != null) {
-                values[property.ordinal()] = value;
-                states[property.ordinal()] = State.JAXPDOTPROPERTIES;
-            }
-        } catch (NumberFormatException e) {
-            //invalid setting ignored
-        }
-    }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/cmdline/Compile.java	Tue Feb 11 15:40:12 2014 -0800
@@ -23,6 +23,7 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.cmdline;
 
+import com.sun.org.apache.xalan.internal.utils.FeatureManager;
 import java.io.File;
 import java.net.URL;
 import java.util.Vector;
@@ -77,7 +78,7 @@
             final GetOpt getopt = new GetOpt(args, "o:d:j:p:uxhsinv");
             if (args.length < 1) printUsage();
 
-            final XSLTC xsltc = new XSLTC(true);
+            final XSLTC xsltc = new XSLTC(true, new FeatureManager());
             xsltc.init();
 
             int c;
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/FunctionCall.java	Tue Feb 11 15:40:12 2014 -0800
@@ -42,6 +42,7 @@
 import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
 import com.sun.org.apache.bcel.internal.generic.NEW;
 import com.sun.org.apache.bcel.internal.generic.PUSH;
+import com.sun.org.apache.xalan.internal.utils.FeatureManager;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
@@ -717,6 +718,8 @@
         final ConstantPoolGen cpg = classGen.getConstantPool();
         final InstructionList il = methodGen.getInstructionList();
         final boolean isSecureProcessing = classGen.getParser().getXSLTC().isSecureProcessing();
+        final boolean isExtensionFunctionEnabled = classGen.getParser().getXSLTC()
+                .getFeature(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION);
         int index;
 
         // Translate calls to methods in the BasisLibrary
@@ -760,7 +763,7 @@
             il.append(new INVOKESTATIC(index));
         }
         else if (_isExtConstructor) {
-            if (isSecureProcessing)
+            if (isSecureProcessing && !isExtensionFunctionEnabled)
                 translateUnallowedExtension(cpg, il);
 
             final String clazz =
@@ -822,7 +825,7 @@
         }
         // Invoke function calls that are handled in separate classes
         else {
-            if (isSecureProcessing)
+            if (isSecureProcessing && !isExtensionFunctionEnabled)
                 translateUnallowedExtension(cpg, il);
 
             final String clazz = _chosenMethod.getDeclaringClass().getName();
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java	Tue Feb 11 15:40:12 2014 -0800
@@ -43,6 +43,8 @@
 
 import com.sun.org.apache.bcel.internal.classfile.JavaClass;
 import com.sun.org.apache.xalan.internal.XalanConstants;
+import com.sun.org.apache.xalan.internal.utils.FeatureManager;
+import com.sun.org.apache.xalan.internal.utils.FeatureManager.Feature;
 import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
 import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
 import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
@@ -148,11 +150,14 @@
 
     private XMLSecurityManager _xmlSecurityManager;
 
+    private final FeatureManager _featureManager;
+
     /**
      * XSLTC compiler constructor
      */
-    public XSLTC(boolean useServicesMechanism) {
+    public XSLTC(boolean useServicesMechanism, FeatureManager featureManager) {
         _parser = new Parser(this, useServicesMechanism);
+        _featureManager = featureManager;
     }
 
     /**
@@ -182,6 +187,15 @@
         _useServicesMechanism = flag;
     }
 
+     /**
+     * Return the value of the specified feature
+     * @param name name of the feature
+     * @return true if the feature is enabled, false otherwise
+     */
+    public boolean getFeature(Feature name) {
+        return _featureManager.isFeatureEnabled(name);
+    }
+
     /**
      * Return allowed protocols for accessing external stylesheet.
      */
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "More than one stylesheet defined in the same file."},
 
@@ -1012,12 +1018,5 @@
 
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents = new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "S'ha definit m\u00e9s d'un full d'estils en el mateix fitxer."},
 
@@ -853,12 +859,5 @@
         "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-      return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents = new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "V\u00edce ne\u017e jedna p\u0159edloha stylu je definov\u00e1na ve stejn\u00e9m souboru."},
 
@@ -853,12 +859,5 @@
         "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-      return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "Mehrere Stylesheets in derselben Datei definiert."},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: Feature kann nicht auf \"false\" gesetzt werden, wenn Security Manager vorhanden ist."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "Se ha definido m\u00E1s de una hoja de estilo en el mismo archivo."},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: no se puede definir la funci\u00F3n en false cuando est\u00E1 presente el gestor de seguridad."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "Plusieurs feuilles de style d\u00E9finies dans le m\u00EAme fichier."},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING : impossible de d\u00E9finir la fonctionnalit\u00E9 sur False en pr\u00E9sence du gestionnaire de s\u00E9curit\u00E9."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "Sono stati definiti pi\u00F9 fogli di stile nello stesso file."},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: impossibile impostare la funzione su false se \u00E8 presente Security Manager."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "\u540C\u3058\u30D5\u30A1\u30A4\u30EB\u306B\u8907\u6570\u306E\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002"},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: \u30BB\u30AD\u30E5\u30EA\u30C6\u30A3\u30FB\u30DE\u30CD\u30FC\u30B8\u30E3\u304C\u5B58\u5728\u3059\u308B\u3068\u304D\u3001\u6A5F\u80FD\u3092false\u306B\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093\u3002"}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "\uB3D9\uC77C\uD55C \uD30C\uC77C\uC5D0 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uAC00 \uB450 \uAC1C \uC774\uC0C1 \uC815\uC758\uB418\uC5C8\uC2B5\uB2C8\uB2E4."},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: \uBCF4\uC548 \uAD00\uB9AC\uC790\uAC00 \uC788\uC744 \uACBD\uC6B0 \uAE30\uB2A5\uC744 false\uB85C \uC124\uC815\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "Mais de uma folha de estilos definida no mesmo arquivo."},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: N\u00E3o \u00E9 poss\u00EDvel definir o recurso como falso quando o gerenciador de seguran\u00E7a est\u00E1 presente."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "Viac ne\u017e jeden \u0161t\u00fdl dokumentu bol definovan\u00fd v rovnakom s\u00fabore."},
 
@@ -853,12 +859,5 @@
         "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-      return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "Fler \u00E4n en formatmall har definierats i samma fil."},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: Funktionen kan inte anges till false om s\u00E4kerhetshanteraren anv\u00E4nds."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "\u540C\u4E00\u6587\u4EF6\u4E2D\u5B9A\u4E49\u4E86\u591A\u4E2A\u6837\u5F0F\u8868\u3002"},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: \u5B58\u5728 Security Manager \u65F6, \u65E0\u6CD5\u5C06\u6B64\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u5047\u201D\u3002"}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java	Tue Feb 11 15:40:12 2014 -0800
@@ -90,7 +90,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+      return new Object[][] {
         {ErrorMsg.MULTIPLE_STYLESHEET_ERR,
         "\u76F8\u540C\u6A94\u6848\u4E2D\u5B9A\u7FA9\u4E86\u8D85\u904E\u4E00\u500B\u6A23\u5F0F\u8868\u3002"},
 
@@ -913,12 +919,5 @@
         "FEATURE_SECURE_PROCESSING: \u5B89\u5168\u7BA1\u7406\u7A0B\u5F0F\u5B58\u5728\u6642\uFF0C\u7121\u6CD5\u5C07\u529F\u80FD\u8A2D\u70BA\u507D\u3002"}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/BasisLibrary.java	Tue Feb 11 15:40:12 2014 -0800
@@ -955,6 +955,9 @@
             if (Double.isNaN(d) || Double.isInfinite(d))
                 return(Double.toString(d));
 
+            //Convert -0.0 to +0.0 other values remains the same
+            d = d + 0.0;
+
             // Use the XPath formatter to ignore locales
             StringBuffer result = threadLocalStringBuffer.get();
             result.setLength(0);
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "Use of the extension element ''{0}'' is not allowed when the secure processing feature is set to true."},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java	Tue Feb 11 15:40:12 2014 -0800
@@ -79,7 +79,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -223,13 +229,6 @@
         "No s''ha pogut resoldre la refer\u00e8ncia d''URI ''{0}''."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-      return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java	Tue Feb 11 15:40:12 2014 -0800
@@ -79,7 +79,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -223,13 +229,6 @@
         "Nelze p\u0159elo\u017eit odkazy URI ''{0}''."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-      return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "Verwendung des Erweiterungselements \"{0}\" ist nicht zul\u00E4ssig, wenn das Feature f\u00FCr die sichere Verarbeitung auf \"true\" gesetzt ist."},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "El uso del elemento de extensi\u00F3n ''{0}'' no est\u00E1 permitido cuando la funci\u00F3n de procesamiento seguro se ha definido en true."},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "L''utilisation de l''\u00E9l\u00E9ment d''extension ''{0}'' n''est pas autoris\u00E9e lorsque la fonctionnalit\u00E9 de traitement s\u00E9curis\u00E9 est d\u00E9finie sur True."},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "Non \u00E8 consentito utilizzare l''elemento di estensione ''{0}'' se la funzione di elaborazione sicura \u00E8 impostata su true."},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "\u30BB\u30AD\u30E5\u30A2\u51E6\u7406\u6A5F\u80FD\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3068\u304D\u3001\u62E1\u5F35\u8981\u7D20''{0}''\u306E\u4F7F\u7528\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "\uBCF4\uC548 \uCC98\uB9AC \uAE30\uB2A5\uC774 true\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 \uD655\uC7A5 \uC694\uC18C ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "O uso do elemento da extens\u00E3o ''{0}'' n\u00E3o ser\u00E1 permitido quando o recurso de processamento seguro for definido como verdadeiro."},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java	Tue Feb 11 15:40:12 2014 -0800
@@ -79,7 +79,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -223,13 +229,6 @@
         "Nebolo mo\u017en\u00e9 rozl\u00ed\u0161i\u0165 referenciu URI ''{0}''."}
     };
 
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-      return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "Anv\u00E4ndning av till\u00E4ggselementet ''{0}'' \u00E4r inte till\u00E5tet n\u00E4r s\u00E4ker bearbetning till\u00E4mpas."},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "\u5F53\u5B89\u5168\u5904\u7406\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u65F6, \u4E0D\u5141\u8BB8\u4F7F\u7528\u6269\u5C55\u5143\u7D20 ''{0}''\u3002"},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java	Tue Feb 11 15:40:12 2014 -0800
@@ -81,7 +81,13 @@
  */
 
     // These message should be read from a locale-specific resource bundle
-    private static final Object[][] _contents =  new Object[][] {
+    /** Get the lookup table for error messages.
+     *
+     * @return The message lookup table.
+     */
+    public Object[][] getContents()
+    {
+        return new Object[][] {
 
         /*
          * Note to translators:  the substitution text in the following message
@@ -276,13 +282,6 @@
         {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR,
         "\u7576\u5B89\u5168\u8655\u7406\u529F\u80FD\u8A2D\u70BA\u771F\u6642\uFF0C\u4E0D\u5141\u8A31\u4F7F\u7528\u64F4\u5145\u5957\u4EF6\u5143\u7D20 ''{0}''\u3002"},
     };
-    /** Get the lookup table for error messages.
-     *
-     * @return The message lookup table.
-     */
-    public Object[][] getContents()
-    {
-        return _contents;
     }
 
 }
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java	Tue Feb 11 15:40:12 2014 -0800
@@ -95,7 +95,7 @@
         _tfactory = tfactory;
 
         // Instantiate XSLTC and get reference to parser object
-        XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism());
+        XSLTC xsltc = new XSLTC(tfactory.useServicesMechnism(), tfactory.getFeatureManager());
         if (tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING))
             xsltc.setSecureProcessing(true);
 
--- a/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java	Tue Feb 11 15:40:12 2014 -0800
@@ -23,6 +23,23 @@
 
 package com.sun.org.apache.xalan.internal.xsltc.trax;
 
+import com.sun.org.apache.xalan.internal.XalanConstants;
+import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
+import com.sun.org.apache.xalan.internal.utils.FeatureManager;
+import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase;
+import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
+import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
+import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
+import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager;
+import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property;
+import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase.State;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
+import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
+import com.sun.org.apache.xml.internal.utils.StopParseException;
+import com.sun.org.apache.xml.internal.utils.StylesheetPIHandler;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -37,11 +54,9 @@
 import java.util.Vector;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
-
 import javax.xml.XMLConstants;
+import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.ParserConfigurationException;
 
 import javax.xml.transform.ErrorListener;
 import javax.xml.transform.Source;
@@ -58,27 +73,9 @@
 import javax.xml.transform.sax.SAXTransformerFactory;
 import javax.xml.transform.sax.TemplatesHandler;
 import javax.xml.transform.sax.TransformerHandler;
+import javax.xml.transform.stax.*;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
-import javax.xml.transform.stax.*;
-
-import com.sun.org.apache.xml.internal.utils.StylesheetPIHandler;
-import com.sun.org.apache.xml.internal.utils.StopParseException;
-
-import com.sun.org.apache.xalan.internal.XalanConstants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.Constants;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC;
-import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg;
-import com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager;
-import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
-import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
-import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.State;
-import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager;
-
 import org.xml.sax.InputSource;
 import org.xml.sax.XMLFilter;
 import org.xml.sax.XMLReader;
@@ -240,6 +237,8 @@
     private XMLSecurityPropertyManager _xmlSecurityPropertyMgr;
     private XMLSecurityManager _xmlSecurityManager;
 
+    private final FeatureManager _featureManager;
+
     /**
      * javax.xml.transform.sax.TransformerFactory implementation.
      */
@@ -254,10 +253,13 @@
     private TransformerFactoryImpl(boolean useServicesMechanism) {
         this.m_DTMManagerClass = XSLTCDTMManager.getDTMManagerClass(useServicesMechanism);
         this._useServicesMechanism = useServicesMechanism;
+        _featureManager = new FeatureManager();
 
         if (System.getSecurityManager() != null) {
             _isSecureMode = true;
             _isNotSecureProcessing = false;
+            _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
+                    FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
         }
 
         _xmlSecurityPropertyMgr = new XMLSecurityPropertyManager();
@@ -513,6 +515,10 @@
                         Property.ACCESS_EXTERNAL_STYLESHEET);
             }
 
+            if (value && _featureManager != null) {
+                _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
+                        FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
+            }
             return;
         }
         else if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
@@ -521,6 +527,11 @@
                 _useServicesMechanism = value;
         }
         else {
+            if (_featureManager != null &&
+                    _featureManager.setValue(name, State.APIPROPERTY, value)) {
+                return;
+            }
+
             // unknown feature
             ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_UNSUPPORTED_FEATURE, name);
             throw new TransformerConfigurationException(err.toString());
@@ -569,6 +580,13 @@
                 return !_isNotSecureProcessing;
         }
 
+        /** Check to see if the property is managed by the security manager **/
+        String propertyValue = (_featureManager != null) ?
+                _featureManager.getValueAsString(name) : null;
+        if (propertyValue != null) {
+            return Boolean.parseBoolean(propertyValue);
+        }
+
         // Feature not supported
         return false;
     }
@@ -579,6 +597,13 @@
         return _useServicesMechanism;
     }
 
+     /**
+     * @return the feature manager
+     */
+    public FeatureManager getFeatureManager() {
+        return _featureManager;
+    }
+
     /**
      * javax.xml.transform.sax.TransformerFactory implementation.
      * Get the object that is used by default during the transformation to
@@ -859,7 +884,7 @@
         }
 
         // Create and initialize a stylesheet compiler
-        final XSLTC xsltc = new XSLTC(_useServicesMechanism);
+        final XSLTC xsltc = new XSLTC(_useServicesMechanism, _featureManager);
         if (_debug) xsltc.setDebug(true);
         if (_enableInlining)
                 xsltc.setTemplateInlining(true);
--- a/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java	Tue Feb 11 15:40:12 2014 -0800
@@ -1422,7 +1422,7 @@
                             }
                             ch = data.charAt(currentOffset);
                         } while (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D);
-                        if (currentOffset == endOffset || ch == '|') {
+                        if (currentOffset == endOffset || ch == '|' || ch == '/') {
                             addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD);
                             starIsMultiplyOperator = true;
                             break;
--- a/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java	Tue Feb 11 15:40:12 2014 -0800
@@ -20,6 +20,8 @@
 
 package com.sun.org.apache.xerces.internal.jaxp;
 
+import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter;
+import java.util.Locale;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.DefaultHandler;
@@ -30,6 +32,11 @@
 class DefaultValidationErrorHandler extends DefaultHandler {
     static private int ERROR_COUNT_LIMIT = 10;
     private int errorCount = 0;
+    private Locale locale = Locale.getDefault();
+
+    public DefaultValidationErrorHandler(Locale locale) {
+        this.locale = locale;
+    }
 
     // XXX Fix message i18n
     public void error(SAXParseException e) throws SAXException {
@@ -38,11 +45,8 @@
             return;
         } else if (errorCount == 0) {
             // Print a warning before the first error
-            System.err.println("Warning: validation was turned on but an org.xml.sax.ErrorHandler was not");
-            System.err.println("set, which is probably not what is desired.  Parser will use a default");
-            System.err.println("ErrorHandler to print the first " +
-                               ERROR_COUNT_LIMIT +               " errors.  Please call");
-            System.err.println("the 'setErrorHandler' method to fix this.");
+            System.err.println(SAXMessageFormatter.formatMessage(locale,
+                        "errorHandlerNotSet", new Object [] {errorCount}));
         }
 
         String systemId = e.getSystemId();
--- a/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java	Tue Feb 11 15:40:12 2014 -0800
@@ -140,7 +140,7 @@
         // validation errors with a warning telling the user to set an
         // ErrorHandler
         if (dbf.isValidating()) {
-            fInitErrorHandler = new DefaultValidationErrorHandler();
+            fInitErrorHandler = new DefaultValidationErrorHandler(domParser.getXMLParserConfiguration().getLocale());
             setErrorHandler(fInitErrorHandler);
         }
         else {
--- a/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java	Tue Feb 11 15:40:12 2014 -0800
@@ -20,15 +20,6 @@
 
 package com.sun.org.apache.xerces.internal.jaxp;
 
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.XMLConstants;
-import javax.xml.validation.Schema;
-
 import com.sun.org.apache.xerces.internal.impl.Constants;
 import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
 import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
@@ -46,6 +37,14 @@
 import com.sun.org.apache.xerces.internal.xs.AttributePSVI;
 import com.sun.org.apache.xerces.internal.xs.ElementPSVI;
 import com.sun.org.apache.xerces.internal.xs.PSVIProvider;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import javax.xml.XMLConstants;
+import javax.xml.validation.Schema;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.ErrorHandler;
 import org.xml.sax.HandlerBase;
@@ -186,7 +185,7 @@
         // validation errors with a warning telling the user to set an
         // ErrorHandler.
         if (spf.isValidating()) {
-            fInitErrorHandler = new DefaultValidationErrorHandler();
+            fInitErrorHandler = new DefaultValidationErrorHandler(xmlReader.getLocale());
             xmlReader.setErrorHandler(fInitErrorHandler);
         }
         else {
@@ -685,6 +684,10 @@
             return super.getProperty(name);
         }
 
+        Locale getLocale() {
+            return fConfiguration.getLocale();
+        }
+
         private void setSchemaValidatorFeature(String name, boolean value)
             throws SAXNotRecognizedException, SAXNotSupportedException {
             try {
--- a/src/com/sun/org/apache/xerces/internal/util/URI.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xerces/internal/util/URI.java	Tue Feb 11 15:40:12 2014 -0800
@@ -689,9 +689,13 @@
         if (!initializeAuthority(uriSpec.substring(startPos, index))) {
           index = startPos - 2;
         }
-      }
-      else {
+      } else if (index < uriSpecLen) {
+        //Same as java.net.URI:
+        // DEVIATION: Allow empty authority prior to non-empty
+        // path, query component or fragment identifier
         m_host = "";
+      } else {
+        throw new MalformedURIException("Expected authority.");
       }
     }
 
--- a/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xerces/internal/utils/SecuritySupport.java	Tue Feb 11 15:40:12 2014 -0800
@@ -211,7 +211,7 @@
         if (i > 0) {
             return uri.substring(i+1, uri.length());
         }
-        return "";
+        return uri;
     }
 
     /**
--- a/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xml/internal/dtm/ref/DTMAxisIterNodeList.java	Tue Feb 11 15:40:12 2014 -0800
@@ -105,15 +105,15 @@
      */
     public Node item(int index) {
         if (m_iter != null) {
-            int node;
+            int node = 0;
             int count = m_cachedNodes.size();
 
             if (count > index) {
                 node = m_cachedNodes.elementAt(index);
                 return m_dtm.getNode(node);
             } else if (m_last == -1) {
-                while (((node = m_iter.next()) != DTMAxisIterator.END)
-                           && count <= index) {
+                while (count <= index
+                        && ((node = m_iter.next()) != DTMAxisIterator.END)) {
                     m_cachedNodes.addElement(node);
                     count++;
                 }
--- a/src/com/sun/org/apache/xpath/internal/XPathContext.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xpath/internal/XPathContext.java	Tue Feb 11 15:40:12 2014 -0800
@@ -103,8 +103,7 @@
    * the DTMManager, it really is a proxy for this object, which
    * is the real DTMManager.
    */
-  protected DTMManager m_dtmManager = DTMManager.newInstance(
-                   com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory());
+  protected DTMManager m_dtmManager = null;
 
   /**
    * Return the DTMManager object.  Though XPathContext context extends
--- a/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xpath/internal/jaxp/JAXPExtensionsProvider.java	Tue Feb 11 15:40:12 2014 -0800
@@ -33,6 +33,7 @@
 import com.sun.org.apache.xpath.internal.objects.XNodeSet;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xalan.internal.utils.FeatureManager;
 
 import com.sun.org.apache.xpath.internal.functions.FuncExtFunction;
 import java.util.Vector;
@@ -54,9 +55,12 @@
     }
 
     public JAXPExtensionsProvider(XPathFunctionResolver resolver,
-        boolean featureSecureProcessing ) {
+        boolean featureSecureProcessing, FeatureManager featureManager ) {
         this.resolver = resolver;
-        this.extensionInvocationDisabled = featureSecureProcessing;
+        if (featureSecureProcessing &&
+                !featureManager.isFeatureEnabled(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION)) {
+            this.extensionInvocationDisabled = true;
+        }
     }
 
     /**
--- a/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xpath/internal/jaxp/XPathExpressionImpl.java	Tue Feb 11 15:40:12 2014 -0800
@@ -30,6 +30,7 @@
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
+import com.sun.org.apache.xalan.internal.utils.FeatureManager;
 
 import javax.xml.namespace.NamespaceContext;
 import javax.xml.namespace.QName;
@@ -67,33 +68,36 @@
     private boolean featureSecureProcessing = false;
 
     private boolean useServicesMechanism = true;
+
+    private final FeatureManager featureManager;
+
     /** Protected constructor to prevent direct instantiation; use compile()
      * from the context.
      */
-    protected XPathExpressionImpl() { };
+    protected XPathExpressionImpl() {
+        this(null, null, null, null,
+             false, true, new FeatureManager());
+    };
 
     protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
             JAXPPrefixResolver prefixResolver,
             XPathFunctionResolver functionResolver,
             XPathVariableResolver variableResolver ) {
-        this.xpath = xpath;
-        this.prefixResolver = prefixResolver;
-        this.functionResolver = functionResolver;
-        this.variableResolver = variableResolver;
-        this.featureSecureProcessing = false;
+        this(xpath, prefixResolver, functionResolver, variableResolver,
+             false, true, new FeatureManager());
     };
 
     protected XPathExpressionImpl(com.sun.org.apache.xpath.internal.XPath xpath,
-            JAXPPrefixResolver prefixResolver,
-            XPathFunctionResolver functionResolver,
-            XPathVariableResolver variableResolver,
-            boolean featureSecureProcessing, boolean useServicesMechanism ) {
+            JAXPPrefixResolver prefixResolver,XPathFunctionResolver functionResolver,
+            XPathVariableResolver variableResolver, boolean featureSecureProcessing,
+            boolean useServicesMechanism, FeatureManager featureManager ) {
         this.xpath = xpath;
         this.prefixResolver = prefixResolver;
         this.functionResolver = functionResolver;
         this.variableResolver = variableResolver;
         this.featureSecureProcessing = featureSecureProcessing;
         this.useServicesMechanism = useServicesMechanism;
+        this.featureManager = featureManager;
     };
 
     public void setXPath (com.sun.org.apache.xpath.internal.XPath xpath ) {
@@ -111,7 +115,7 @@
         com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null;
         if ( functionResolver != null ) {
             JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
-                    functionResolver, featureSecureProcessing );
+                    functionResolver, featureSecureProcessing, featureManager );
             xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep );
         } else {
             xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext();
--- a/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xpath/internal/jaxp/XPathFactoryImpl.java	Tue Feb 11 15:40:12 2014 -0800
@@ -24,6 +24,8 @@
 import com.sun.org.apache.xalan.internal.XalanConstants;
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
+import com.sun.org.apache.xalan.internal.utils.FeatureManager;
+import com.sun.org.apache.xalan.internal.utils.FeaturePropertyBase;
 
 import javax.xml.XMLConstants;
 import javax.xml.xpath.XPathFactory;
@@ -68,6 +70,8 @@
 
         private boolean _useServicesMechanism = true;
 
+        private final FeatureManager _featureManager;
+
         public XPathFactoryImpl() {
             this(true);
         }
@@ -77,9 +81,12 @@
         }
 
         public XPathFactoryImpl(boolean useServicesMechanism) {
+            _featureManager = new FeatureManager();
             if (System.getSecurityManager() != null) {
                 _isSecureMode = true;
                 _isNotSecureProcessing = false;
+                _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
+                        FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
             }
             this._useServicesMechanism = useServicesMechanism;
         }
@@ -131,7 +138,8 @@
         public javax.xml.xpath.XPath newXPath() {
             return new com.sun.org.apache.xpath.internal.jaxp.XPathImpl(
                     xPathVariableResolver, xPathFunctionResolver,
-                    !_isNotSecureProcessing, _useServicesMechanism );
+                    !_isNotSecureProcessing, _useServicesMechanism,
+                    _featureManager );
         }
 
         /**
@@ -181,6 +189,10 @@
                 }
 
                 _isNotSecureProcessing = !value;
+                if (value && _featureManager != null) {
+                    _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
+                            FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
+                }
 
                 // all done processing feature
                 return;
@@ -192,6 +204,11 @@
                 return;
             }
 
+            if (_featureManager != null &&
+                    _featureManager.setValue(name, FeaturePropertyBase.State.APIPROPERTY, value)) {
+                return;
+            }
+
             // unknown feature
             String fmsg = XSLMessages.createXPATHMessage(
                     XPATHErrorResources.ER_FEATURE_UNKNOWN,
@@ -240,6 +257,14 @@
             if (name.equals(XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
                 return _useServicesMechanism;
             }
+
+            /** Check to see if the property is managed by the security manager **/
+            String propertyValue = (_featureManager != null) ?
+                    _featureManager.getValueAsString(name) : null;
+            if (propertyValue != null) {
+                return _featureManager.isFeatureEnabled(name);
+            }
+
             // unknown feature
             String fmsg = XSLMessages.createXPATHMessage(
                     XPATHErrorResources.ER_GETTING_UNKNOWN_FEATURE,
--- a/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/com/sun/org/apache/xpath/internal/jaxp/XPathImpl.java	Tue Feb 11 15:40:12 2014 -0800
@@ -35,6 +35,7 @@
 import com.sun.org.apache.xpath.internal.res.XPATHErrorResources;
 import com.sun.org.apache.xalan.internal.res.XSLMessages;
 import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
+import com.sun.org.apache.xalan.internal.utils.FeatureManager;
 
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
@@ -70,18 +71,20 @@
     // extensions function need to throw XPathFunctionException
     private boolean featureSecureProcessing = false;
     private boolean useServiceMechanism = true;
+    private final FeatureManager featureManager;
 
     XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr ) {
-        this.origVariableResolver = this.variableResolver = vr;
-        this.origFunctionResolver = this.functionResolver = fr;
+        this(vr, fr, false, true, new FeatureManager());
     }
 
     XPathImpl( XPathVariableResolver vr, XPathFunctionResolver fr,
-            boolean featureSecureProcessing, boolean useServiceMechanism ) {
+            boolean featureSecureProcessing, boolean useServiceMechanism,
+            FeatureManager featureManager) {
         this.origVariableResolver = this.variableResolver = vr;
         this.origFunctionResolver = this.functionResolver = fr;
         this.featureSecureProcessing = featureSecureProcessing;
         this.useServiceMechanism = useServiceMechanism;
+        this.featureManager = featureManager;
     }
 
     /**
@@ -190,7 +193,7 @@
         com.sun.org.apache.xpath.internal.XPathContext xpathSupport = null;
         if ( functionResolver != null ) {
             JAXPExtensionsProvider jep = new JAXPExtensionsProvider(
-                    functionResolver, featureSecureProcessing );
+                    functionResolver, featureSecureProcessing, featureManager );
             xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext( jep );
         } else {
             xpathSupport = new com.sun.org.apache.xpath.internal.XPathContext();
@@ -391,7 +394,7 @@
             // Can have errorListener
             XPathExpressionImpl ximpl = new XPathExpressionImpl (xpath,
                     prefixResolver, functionResolver, variableResolver,
-                    featureSecureProcessing, useServiceMechanism );
+                    featureSecureProcessing, useServiceMechanism, featureManager );
             return ximpl;
         } catch ( javax.xml.transform.TransformerException te ) {
             throw new XPathExpressionException ( te ) ;
--- a/src/javax/xml/xpath/XPathException.java	Tue Feb 11 15:12:01 2014 -0800
+++ b/src/javax/xml/xpath/XPathException.java	Tue Feb 11 15:40:12 2014 -0800
@@ -26,6 +26,11 @@
 package javax.xml.xpath;
 
 import java.io.PrintWriter;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamField;
+import java.io.InvalidClassException;
 
 /**
  * <code>XPathException</code> represents a generic XPath exception.</p>
@@ -36,7 +41,9 @@
  */
 public class XPathException extends Exception {
 
-    private final Throwable cause;
+    private static final ObjectStreamField[] serialPersistentFields = {
+        new ObjectStreamField( "cause", Throwable.class )
+    };
 
     /**
      * <p>Stream Unique Identifier.</p>
@@ -62,7 +69,6 @@
         if ( message == null ) {
             throw new NullPointerException ( "message can't be null");
         }
-        this.cause = null;
     }
 
     /**
@@ -77,8 +83,7 @@
      * @throws NullPointerException if <code>cause</code> is <code>null</code>.
      */
     public XPathException(Throwable cause) {
-        super();
-        this.cause = cause;
+        super(cause);
         if ( cause == null ) {
             throw new NullPointerException ( "cause can't be null");
         }
@@ -90,7 +95,47 @@
      * @return Cause of this XPathException.
      */
     public Throwable getCause() {
-        return cause;
+        return super.getCause();
+    }
+
+    /**
+     * Writes "cause" field to the stream.
+     * The cause is got from the parent class.
+     *
+     * @param out stream used for serialization.
+     * @throws IOException thrown by <code>ObjectOutputStream</code>
+     *
+     */
+    private void writeObject(ObjectOutputStream out)
+            throws IOException
+    {
+        ObjectOutputStream.PutField fields = out.putFields();
+        fields.put("cause", (Throwable) super.getCause());
+        out.writeFields();
+    }
+
+    /**
+     * Reads the "cause" field from the stream.
+     * And initializes the "cause" if it wasn't
+     * done before.
+     *
+     * @param in stream used for deserialization
+     * @throws IOException thrown by <code>ObjectInputStream</code>
+     * @throws ClassNotFoundException  thrown by <code>ObjectInputStream</code>
+     */
+    private void readObject(ObjectInputStream in)
+            throws IOException, ClassNotFoundException
+    {
+        ObjectInputStream.GetField fields = in.readFields();
+        Throwable scause = (Throwable) fields.get("cause", null);
+
+        if (super.getCause() == null && scause != null) {
+            try {
+                super.initCause(scause);
+            } catch(IllegalStateException e) {
+                throw new InvalidClassException("Inconsistent state: two causes");
+            }
+        }
     }
 
     /**