poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1881383 - in /xmlbeans/trunk/src: main/java/org/apache/xmlbeans/ main/java/org/apache/xmlbeans/impl/schema/ main/java/org/apache/xmlbeans/impl/store/ main/java/org/apache/xmlbeans/impl/tool/ main/java/org/apache/xmlbeans/impl/validator/ ma...
Date Tue, 01 Sep 2020 22:25:35 GMT
Author: kiwiwings
Date: Tue Sep  1 22:25:35 2020
New Revision: 1881383

URL: http://svn.apache.org/viewvc?rev=1881383&view=rev
Log:
Move bean property methods from XmlOptionsBeans to XmlOptions
Remove reflection when accessing Saxon XPath / XQuery
Remove access to invalid binding classes of XDK, XQRL, XQRL2000 
Convert XmlOptions string constants to enum

Removed:
    xmlbeans/trunk/src/main/resources/xpath_xquery/
Modified:
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscState.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Cur.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Locale.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Path.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Public2.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Query.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saaj.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saver.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
    xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java
    xmlbeans/trunk/src/test/java/compile/scomp/checkin/XmlBeansCompCheckinTests.java
    xmlbeans/trunk/src/test/java/compile/scomp/detailed/DetailedCompTests.java
    xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java
    xmlbeans/trunk/src/test/java/compile/scomp/som/checkin/PartialSOMCheckinTest.java
    xmlbeans/trunk/src/test/java/compile/scomp/som/detailed/PartialSOMDetailedTest.java
    xmlbeans/trunk/src/test/java/xmlcursor/xpath/xbean_xpath/detailed/AxesTest.java

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/XmlOptions.java Tue Sep  1 22:25:35 2020
@@ -15,6 +15,7 @@
 
 package org.apache.xmlbeans;
 
+import org.apache.xmlbeans.impl.store.Saaj;
 import org.xml.sax.EntityResolver;
 import org.xml.sax.XMLReader;
 
@@ -84,67 +85,77 @@ public class XmlOptions implements java.
     // Complete set of XmlOption's
     //
 
-    // TODO - Add selectPath option to track the seletion (deault is to clean selections fast).
+    // TODO - Add selectPath option to track the seletion (default is to clean selections fast).
+    public enum XmlOptionsKeys {
+        SAVE_NAMESPACES_FIRST,
+        SAVE_SYNTHETIC_DOCUMENT_ELEMENT,
+        SAVE_PRETTY_PRINT,
+        SAVE_PRETTY_PRINT_INDENT,
+        SAVE_PRETTY_PRINT_OFFSET,
+        SAVE_AGGRESSIVE_NAMESPACES,
+        SAVE_USE_DEFAULT_NAMESPACE,
+        SAVE_IMPLICIT_NAMESPACES,
+        SAVE_SUGGESTED_PREFIXES,
+        SAVE_FILTER_PROCINST,
+        SAVE_USE_OPEN_FRAGMENT,
+        SAVE_OUTER,
+        SAVE_INNER,
+        SAVE_NO_XML_DECL,
+        SAVE_SUBSTITUTE_CHARACTERS,
+        SAVE_OPTIMIZE_FOR_SPEED,
+        SAVE_CDATA_LENGTH_THRESHOLD,
+        SAVE_CDATA_ENTITY_COUNT_THRESHOLD,
+        SAVE_SAX_NO_NSDECLS_IN_ATTRIBUTES,
+        LOAD_REPLACE_DOCUMENT_ELEMENT,
+        LOAD_STRIP_WHITESPACE,
+        LOAD_STRIP_COMMENTS,
+        LOAD_STRIP_PROCINSTS,
+        LOAD_LINE_NUMBERS,
+        LOAD_LINE_NUMBERS_END_ELEMENT,
+        LOAD_SAVE_CDATA_BOOKMARKS,
+        LOAD_SUBSTITUTE_NAMESPACES,
+        LOAD_TRIM_TEXT_BUFFER,
+        LOAD_ADDITIONAL_NAMESPACES,
+        LOAD_MESSAGE_DIGEST,
+        LOAD_USE_DEFAULT_RESOLVER,
+        LOAD_USE_XMLREADER,
+        XQUERY_CURRENT_NODE_VAR,
+        XQUERY_VARIABLE_MAP,
+        CHARACTER_ENCODING,
+        ERROR_LISTENER,
+        DOCUMENT_TYPE,
+        DOCUMENT_SOURCE_NAME,
+        COMPILE_SUBSTITUTE_NAMES,
+        COMPILE_NO_VALIDATION,
+        COMPILE_NO_UPA_RULE,
+        COMPILE_NO_PVR_RULE,
+        COMPILE_NO_ANNOTATIONS,
+        COMPILE_DOWNLOAD_URLS,
+        COMPILE_MDEF_NAMESPACES,
+        COMPILE_PARTIAL_TYPESYSTEM,
+        VALIDATE_ON_SET,
+        VALIDATE_TREAT_LAX_AS_SKIP,
+        VALIDATE_STRICT,
+        VALIDATE_TEXT_ONLY,
+        UNSYNCHRONIZED,
+        ENTITY_RESOLVER,
+        BASE_URI,
+        SCHEMA_CODE_PRINTER,
+        GENERATE_JAVA_VERSION,
+        USE_SAME_LOCALE,
+        COPY_USE_NEW_SYNC_DOMAIN,
+        LOAD_ENTITY_BYTES_LIMIT,
+        ENTITY_EXPANSION_LIMIT,
+        LOAD_DTD_GRAMMAR,
+        LOAD_EXTERNAL_DTD,
+        SAAJ_IMPL,
+        LOAD_USE_LOCALE_CHAR_UTIL,
+        PATH_DELEGATE_INTERFACE,
+        XPATH_USE_DELEGATE,
+        XPATH_USE_XMLBEANS,
+        ATTTRIBUTE_VALIDATION_COMPAT_MODE
+    }
 
-    public static final String SAVE_NAMESPACES_FIRST = "SAVE_NAMESPACES_FIRST";
-    public static final String SAVE_SYNTHETIC_DOCUMENT_ELEMENT = "SAVE_SYNTHETIC_DOCUMENT_ELEMENT";
-    public static final String SAVE_PRETTY_PRINT = "SAVE_PRETTY_PRINT";
-    public static final String SAVE_PRETTY_PRINT_INDENT = "SAVE_PRETTY_PRINT_INDENT";
-    public static final String SAVE_PRETTY_PRINT_OFFSET = "SAVE_PRETTY_PRINT_OFFSET";
-    public static final String SAVE_AGGRESSIVE_NAMESPACES = "SAVE_AGGRESSIVE_NAMESPACES";
-    public static final String SAVE_USE_DEFAULT_NAMESPACE = "SAVE_USE_DEFAULT_NAMESPACE";
-    public static final String SAVE_IMPLICIT_NAMESPACES = "SAVE_IMPLICIT_NAMESPACES";
-    public static final String SAVE_SUGGESTED_PREFIXES = "SAVE_SUGGESTED_PREFIXES";
-    public static final String SAVE_FILTER_PROCINST = "SAVE_FILTER_PROCINST";
-    public static final String SAVE_USE_OPEN_FRAGMENT = "SAVE_USE_OPEN_FRAGMENT";
-    public static final String SAVE_OUTER = "SAVE_OUTER";
-    public static final String SAVE_INNER = "SAVE_INNER";
-    public static final String SAVE_NO_XML_DECL = "SAVE_NO_XML_DECL";
-    public static final String SAVE_SUBSTITUTE_CHARACTERS = "SAVE_SUBSTITUTE_CHARACTERS";
-    public static final String SAVE_OPTIMIZE_FOR_SPEED = "SAVE_OPTIMIZE_FOR_SPEED";
-    public static final String SAVE_CDATA_LENGTH_THRESHOLD = "SAVE_CDATA_LENGTH_THRESHOLD";
-    public static final String SAVE_CDATA_ENTITY_COUNT_THRESHOLD = "SAVE_CDATA_ENTITY_COUNT_THRESHOLD";
-    public static final String SAVE_SAX_NO_NSDECLS_IN_ATTRIBUTES = "SAVE_SAX_NO_NSDECLS_IN_ATTRIBUTES";
-    public static final String LOAD_REPLACE_DOCUMENT_ELEMENT = "LOAD_REPLACE_DOCUMENT_ELEMENT";
-    public static final String LOAD_STRIP_WHITESPACE = "LOAD_STRIP_WHITESPACE";
-    public static final String LOAD_STRIP_COMMENTS = "LOAD_STRIP_COMMENTS";
-    public static final String LOAD_STRIP_PROCINSTS = "LOAD_STRIP_PROCINSTS";
-    public static final String LOAD_LINE_NUMBERS = "LOAD_LINE_NUMBERS";
-    public static final String LOAD_LINE_NUMBERS_END_ELEMENT = "LOAD_LINE_NUMBERS_END_ELEMENT";
-    public static final String LOAD_SAVE_CDATA_BOOKMARKS = "LOAD_SAVE_CDATA_BOOKMARKS";
-    public static final String LOAD_SUBSTITUTE_NAMESPACES = "LOAD_SUBSTITUTE_NAMESPACES";
-    public static final String LOAD_TRIM_TEXT_BUFFER = "LOAD_TRIM_TEXT_BUFFER";
-    public static final String LOAD_ADDITIONAL_NAMESPACES = "LOAD_ADDITIONAL_NAMESPACES";
-    public static final String LOAD_MESSAGE_DIGEST = "LOAD_MESSAGE_DIGEST";
-    public static final String LOAD_USE_DEFAULT_RESOLVER = "LOAD_USE_DEFAULT_RESOLVER";
-    public static final String LOAD_USE_XMLREADER = "LOAD_USE_XMLREADER";
-    public static final String XQUERY_CURRENT_NODE_VAR = "XQUERY_CURRENT_NODE_VAR";
-    public static final String XQUERY_VARIABLE_MAP = "XQUERY_VARIABLE_MAP";
-    public static final String CHARACTER_ENCODING = "CHARACTER_ENCODING";
-    public static final String ERROR_LISTENER = "ERROR_LISTENER";
-    public static final String DOCUMENT_TYPE = "DOCUMENT_TYPE";
-    public static final String DOCUMENT_SOURCE_NAME = "DOCUMENT_SOURCE_NAME";
-    public static final String COMPILE_SUBSTITUTE_NAMES = "COMPILE_SUBSTITUTE_NAMES";
-    public static final String COMPILE_NO_VALIDATION = "COMPILE_NO_VALIDATION";
-    public static final String COMPILE_NO_UPA_RULE = "COMPILE_NO_UPA_RULE";
-    public static final String COMPILE_NO_PVR_RULE = "COMPILE_NO_PVR_RULE";
-    public static final String COMPILE_NO_ANNOTATIONS = "COMPILE_NO_ANNOTATIONS";
-    public static final String COMPILE_DOWNLOAD_URLS = "COMPILE_DOWNLOAD_URLS";
-    public static final String COMPILE_MDEF_NAMESPACES = "COMPILE_MDEF_NAMESPACES";
-    public static final String VALIDATE_ON_SET = "VALIDATE_ON_SET";
-    public static final String VALIDATE_TREAT_LAX_AS_SKIP = "VALIDATE_TREAT_LAX_AS_SKIP";
-    public static final String VALIDATE_STRICT = "VALIDATE_STRICT";
-    public static final String VALIDATE_TEXT_ONLY = "VALIDATE_TEXT_ONLY";
-    public static final String UNSYNCHRONIZED = "UNSYNCHRONIZED";
-    public static final String ENTITY_RESOLVER = "ENTITY_RESOLVER";
-    public static final String BASE_URI = "BASE_URI";
-    public static final String SCHEMA_CODE_PRINTER = "SCHEMA_CODE_PRINTER";
-    public static final String GENERATE_JAVA_VERSION = "GENERATE_JAVA_VERSION";
-    public static final String COPY_USE_NEW_SYNC_DOMAIN = "COPY_USE_NEW_LOCALE";
-    public static final String LOAD_ENTITY_BYTES_LIMIT = "LOAD_ENTITY_BYTES_LIMIT";
-    public static final String ENTITY_EXPANSION_LIMIT = "ENTITY_EXPANSION_LIMIT";
-    public static final String LOAD_DTD_GRAMMAR = "LOAD_DTD_GRAMMAR";
-    public static final String LOAD_EXTERNAL_DTD = "LOAD_EXTERNAL_DTD";
 
     public static final int DEFAULT_ENTITY_EXPANSION_LIMIT = 2048;
     public static final String GENERATE_JAVA_14 = "1.4";
@@ -160,7 +171,7 @@ public class XmlOptions implements java.
 
     private static final long serialVersionUID = 1L;
 
-    private Map<String, Object> _map = new HashMap<>();
+    private Map<XmlOptionsKeys, Object> _map = new HashMap<>();
 
 
     /**
@@ -193,11 +204,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setSaveNamespacesFirst(boolean b) {
-        return set(SAVE_NAMESPACES_FIRST, b);
+        return set(XmlOptionsKeys.SAVE_NAMESPACES_FIRST, b);
     }
 
     public boolean isSaveNamespacesFirst() {
-        return hasOption(SAVE_NAMESPACES_FIRST);
+        return hasOption(XmlOptionsKeys.SAVE_NAMESPACES_FIRST);
     }
 
 
@@ -212,11 +223,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setSavePrettyPrint(boolean b) {
-        return set(SAVE_PRETTY_PRINT, b);
+        return set(XmlOptionsKeys.SAVE_PRETTY_PRINT, b);
     }
 
     public boolean isSavePrettyPrint() {
-        return hasOption(SAVE_PRETTY_PRINT);
+        return hasOption(XmlOptionsKeys.SAVE_PRETTY_PRINT);
     }
 
 
@@ -230,11 +241,11 @@ public class XmlOptions implements java.
      * @see XmlTokenSource#xmlText(XmlOptions)
      */
     public XmlOptions setSavePrettyPrintIndent(int indent) {
-        return set(SAVE_PRETTY_PRINT_INDENT, indent);
+        return set(XmlOptionsKeys.SAVE_PRETTY_PRINT_INDENT, indent);
     }
 
     public Integer getSavePrettyPrintIndent() {
-        return (Integer) get(SAVE_PRETTY_PRINT_INDENT);
+        return (Integer) get(XmlOptionsKeys.SAVE_PRETTY_PRINT_INDENT);
     }
 
     /**
@@ -247,11 +258,11 @@ public class XmlOptions implements java.
      * @see XmlTokenSource#xmlText(XmlOptions)
      */
     public XmlOptions setSavePrettyPrintOffset(int offset) {
-        return set(SAVE_PRETTY_PRINT_OFFSET, offset);
+        return set(XmlOptionsKeys.SAVE_PRETTY_PRINT_OFFSET, offset);
     }
 
     public Integer getSavePrettyPrintOffset() {
-        return (Integer) get(SAVE_PRETTY_PRINT_OFFSET);
+        return (Integer) get(XmlOptionsKeys.SAVE_PRETTY_PRINT_OFFSET);
     }
 
     /**
@@ -263,11 +274,11 @@ public class XmlOptions implements java.
      * @see XmlTokenSource#save(java.io.File, XmlOptions)
      */
     public XmlOptions setCharacterEncoding(String encoding) {
-        return set(CHARACTER_ENCODING, encoding);
+        return set(XmlOptionsKeys.CHARACTER_ENCODING, encoding);
     }
 
     public String getCharacterEncoding() {
-        return (String) get(CHARACTER_ENCODING);
+        return (String) get(XmlOptionsKeys.CHARACTER_ENCODING);
     }
 
     /**
@@ -279,11 +290,11 @@ public class XmlOptions implements java.
      * @see XmlObject.Factory#parse(java.io.File, XmlOptions)
      */
     public XmlOptions setDocumentType(SchemaType type) {
-        return set(DOCUMENT_TYPE, type);
+        return set(XmlOptionsKeys.DOCUMENT_TYPE, type);
     }
 
     public SchemaType getDocumentType() {
-        return (SchemaType) get(DOCUMENT_TYPE);
+        return (SchemaType) get(XmlOptionsKeys.DOCUMENT_TYPE);
     }
 
 
@@ -331,12 +342,12 @@ public class XmlOptions implements java.
      * @see XmlOptions#setLoadLineNumbers
      */
     public XmlOptions setErrorListener(Collection<XmlError> c) {
-        return set(ERROR_LISTENER, c);
+        return set(XmlOptionsKeys.ERROR_LISTENER, c);
     }
 
     @SuppressWarnings("unchecked")
     public Collection<XmlError> getErrorListener() {
-        return (Collection<XmlError>) get(ERROR_LISTENER);
+        return (Collection<XmlError>) get(XmlOptionsKeys.ERROR_LISTENER);
     }
 
     /**
@@ -354,11 +365,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setSaveAggressiveNamespaces(boolean b) {
-        return set(SAVE_AGGRESSIVE_NAMESPACES, b);
+        return set(XmlOptionsKeys.SAVE_AGGRESSIVE_NAMESPACES, b);
     }
 
     public boolean isSaveAggressiveNamespaces() {
-        return hasOption(SAVE_AGGRESSIVE_NAMESPACES);
+        return hasOption(XmlOptionsKeys.SAVE_AGGRESSIVE_NAMESPACES);
     }
 
 
@@ -371,11 +382,11 @@ public class XmlOptions implements java.
      * @see XmlTokenSource#xmlText(XmlOptions)
      */
     public XmlOptions setSaveSyntheticDocumentElement(QName name) {
-        return set(SAVE_SYNTHETIC_DOCUMENT_ELEMENT, name);
+        return set(XmlOptionsKeys.SAVE_SYNTHETIC_DOCUMENT_ELEMENT, name);
     }
 
     public QName getSaveSyntheticDocumentElement() {
-        return (QName) get(SAVE_SYNTHETIC_DOCUMENT_ELEMENT);
+        return (QName) get(XmlOptionsKeys.SAVE_SYNTHETIC_DOCUMENT_ELEMENT);
     }
 
 
@@ -392,11 +403,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setUseDefaultNamespace(boolean b) {
-        return set(SAVE_USE_DEFAULT_NAMESPACE, b);
+        return set(XmlOptionsKeys.SAVE_USE_DEFAULT_NAMESPACE, b);
     }
 
     public boolean isUseDefaultNamespace() {
-        return hasOption(SAVE_USE_DEFAULT_NAMESPACE);
+        return hasOption(XmlOptionsKeys.SAVE_USE_DEFAULT_NAMESPACE);
     }
 
     /**
@@ -410,12 +421,12 @@ public class XmlOptions implements java.
      * @see XmlTokenSource#xmlText(XmlOptions)
      */
     public XmlOptions setSaveImplicitNamespaces(Map<String, String> implicitNamespaces) {
-        return set(SAVE_IMPLICIT_NAMESPACES, implicitNamespaces);
+        return set(XmlOptionsKeys.SAVE_IMPLICIT_NAMESPACES, implicitNamespaces);
     }
 
     @SuppressWarnings("unchecked")
     public Map<String, String> getSaveImplicitNamespaces() {
-        return (Map<String, String>) get(SAVE_IMPLICIT_NAMESPACES);
+        return (Map<String, String>) get(XmlOptionsKeys.SAVE_IMPLICIT_NAMESPACES);
     }
 
     /**
@@ -427,12 +438,12 @@ public class XmlOptions implements java.
      * @see XmlTokenSource#xmlText(XmlOptions)
      */
     public XmlOptions setSaveSuggestedPrefixes(Map<String, String> suggestedPrefixes) {
-        return set(SAVE_SUGGESTED_PREFIXES, suggestedPrefixes);
+        return set(XmlOptionsKeys.SAVE_SUGGESTED_PREFIXES, suggestedPrefixes);
     }
 
     @SuppressWarnings("unchecked")
     public Map<String, String> getSaveSuggestedPrefixes() {
-        return (Map<String, String>) get(SAVE_SUGGESTED_PREFIXES);
+        return (Map<String, String>) get(XmlOptionsKeys.SAVE_SUGGESTED_PREFIXES);
     }
 
     /**
@@ -445,11 +456,11 @@ public class XmlOptions implements java.
      * @see XmlTokenSource#xmlText(XmlOptions)
      */
     public XmlOptions setSaveFilterProcinst(String filterProcinst) {
-        return set(SAVE_FILTER_PROCINST, filterProcinst);
+        return set(XmlOptionsKeys.SAVE_FILTER_PROCINST, filterProcinst);
     }
 
     public String getSaveFilterProcinst() {
-        return (String) get(SAVE_FILTER_PROCINST);
+        return (String) get(XmlOptionsKeys.SAVE_FILTER_PROCINST);
     }
 
     /**
@@ -465,11 +476,11 @@ public class XmlOptions implements java.
      */
     public XmlOptions setSaveSubstituteCharacters(
         XmlOptionCharEscapeMap characterReplacementMap) {
-        return set(SAVE_SUBSTITUTE_CHARACTERS, characterReplacementMap);
+        return set(XmlOptionsKeys.SAVE_SUBSTITUTE_CHARACTERS, characterReplacementMap);
     }
 
     public XmlOptionCharEscapeMap getSaveSubstituteCharacters() {
-        return (XmlOptionCharEscapeMap) get(SAVE_SUBSTITUTE_CHARACTERS);
+        return (XmlOptionCharEscapeMap) get(XmlOptionsKeys.SAVE_SUBSTITUTE_CHARACTERS);
     }
 
     /**
@@ -484,11 +495,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setSaveUseOpenFrag(boolean b) {
-        return set(SAVE_USE_OPEN_FRAGMENT, b);
+        return set(XmlOptionsKeys.SAVE_USE_OPEN_FRAGMENT, b);
     }
 
     public boolean isSaveUseOpenFrag() {
-        return hasOption(SAVE_USE_OPEN_FRAGMENT);
+        return hasOption(XmlOptionsKeys.SAVE_USE_OPEN_FRAGMENT);
     }
 
     /**
@@ -502,11 +513,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setSaveOuter(boolean b) {
-        return set(SAVE_OUTER, b);
+        return set(XmlOptionsKeys.SAVE_OUTER, b);
     }
 
     public boolean isSaveOuter() {
-        return hasOption(SAVE_OUTER);
+        return hasOption(XmlOptionsKeys.SAVE_OUTER);
     }
 
     /**
@@ -520,11 +531,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setSaveInner(boolean b) {
-        return set(SAVE_INNER, b);
+        return set(XmlOptionsKeys.SAVE_INNER, b);
     }
 
     public boolean isSaveInner() {
-        return hasOption(SAVE_INNER);
+        return hasOption(XmlOptionsKeys.SAVE_INNER);
     }
 
     /**
@@ -539,11 +550,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setSaveNoXmlDecl(boolean b) {
-        return set(SAVE_NO_XML_DECL, b);
+        return set(XmlOptionsKeys.SAVE_NO_XML_DECL, b);
     }
 
     public boolean isSaveNoXmlDecl() {
-        return hasOption(SAVE_NO_XML_DECL);
+        return hasOption(XmlOptionsKeys.SAVE_NO_XML_DECL);
     }
 
 
@@ -566,11 +577,11 @@ public class XmlOptions implements java.
      * @see XmlOptions#setSaveCDataEntityCountThreshold(int)
      */
     public XmlOptions setSaveCDataLengthThreshold(int cdataLengthThreshold) {
-        return set(SAVE_CDATA_LENGTH_THRESHOLD, cdataLengthThreshold);
+        return set(XmlOptionsKeys.SAVE_CDATA_LENGTH_THRESHOLD, cdataLengthThreshold);
     }
 
     public Integer getSaveCDataLengthThreshold() {
-        return (Integer) get(SAVE_CDATA_LENGTH_THRESHOLD);
+        return (Integer) get(XmlOptionsKeys.SAVE_CDATA_LENGTH_THRESHOLD);
     }
 
 
@@ -583,11 +594,11 @@ public class XmlOptions implements java.
      * @see XmlOptions#setSaveCDataLengthThreshold(int)
      */
     public XmlOptions setSaveCDataEntityCountThreshold(int cdataEntityCountThreshold) {
-        return set(SAVE_CDATA_ENTITY_COUNT_THRESHOLD, cdataEntityCountThreshold);
+        return set(XmlOptionsKeys.SAVE_CDATA_ENTITY_COUNT_THRESHOLD, cdataEntityCountThreshold);
     }
 
     public Integer getSaveCDataEntityCountThreshold() {
-        return (Integer) get(SAVE_CDATA_ENTITY_COUNT_THRESHOLD);
+        return (Integer) get(XmlOptionsKeys.SAVE_CDATA_ENTITY_COUNT_THRESHOLD);
     }
 
     /**
@@ -637,11 +648,11 @@ public class XmlOptions implements java.
      * @see CDataBookmark#CDATA_BOOKMARK
      */
     public XmlOptions setUseCDataBookmarks() {
-        return set(LOAD_SAVE_CDATA_BOOKMARKS);
+        return set(XmlOptionsKeys.LOAD_SAVE_CDATA_BOOKMARKS);
     }
 
     public boolean isUseCDataBookmarks() {
-        return hasOption(LOAD_SAVE_CDATA_BOOKMARKS);
+        return hasOption(XmlOptionsKeys.LOAD_SAVE_CDATA_BOOKMARKS);
     }
 
     /**
@@ -654,11 +665,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setSaveSaxNoNSDeclsInAttributes(boolean b) {
-        return set(SAVE_SAX_NO_NSDECLS_IN_ATTRIBUTES, b);
+        return set(XmlOptionsKeys.SAVE_SAX_NO_NSDECLS_IN_ATTRIBUTES, b);
     }
 
     public boolean isSaveSaxNoNSDeclsInAttributes() {
-        return hasOption(SAVE_SAX_NO_NSDECLS_IN_ATTRIBUTES);
+        return hasOption(XmlOptionsKeys.SAVE_SAX_NO_NSDECLS_IN_ATTRIBUTES);
     }
 
 
@@ -670,11 +681,11 @@ public class XmlOptions implements java.
      * @see XmlObject.Factory#parse(java.io.File, XmlOptions)
      */
     public XmlOptions setLoadReplaceDocumentElement(QName replacement) {
-        return set(LOAD_REPLACE_DOCUMENT_ELEMENT, replacement);
+        return set(XmlOptionsKeys.LOAD_REPLACE_DOCUMENT_ELEMENT, replacement);
     }
 
     public QName getLoadReplaceDocumentElement() {
-        return (QName) get(LOAD_REPLACE_DOCUMENT_ELEMENT);
+        return (QName) get(XmlOptionsKeys.LOAD_REPLACE_DOCUMENT_ELEMENT);
     }
 
     /**
@@ -689,11 +700,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setLoadStripWhitespace(boolean b) {
-        return set(LOAD_STRIP_WHITESPACE, b);
+        return set(XmlOptionsKeys.LOAD_STRIP_WHITESPACE, b);
     }
 
     public boolean isSetLoadStripWhitespace() {
-        return hasOption(LOAD_STRIP_WHITESPACE);
+        return hasOption(XmlOptionsKeys.LOAD_STRIP_WHITESPACE);
     }
 
     /**
@@ -707,11 +718,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setLoadStripComments(boolean b) {
-        return set(LOAD_STRIP_COMMENTS, b);
+        return set(XmlOptionsKeys.LOAD_STRIP_COMMENTS, b);
     }
 
     public boolean isLoadStripComments() {
-        return hasOption(LOAD_STRIP_COMMENTS);
+        return hasOption(XmlOptionsKeys.LOAD_STRIP_COMMENTS);
     }
 
     /**
@@ -725,11 +736,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setLoadStripProcinsts(boolean b) {
-        return set(LOAD_STRIP_PROCINSTS, b);
+        return set(XmlOptionsKeys.LOAD_STRIP_PROCINSTS, b);
     }
 
     public boolean isLoadStripProcinsts() {
-        return hasOption(LOAD_STRIP_PROCINSTS);
+        return hasOption(XmlOptionsKeys.LOAD_STRIP_PROCINSTS);
     }
 
     /**
@@ -749,11 +760,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setLoadLineNumbers(boolean b) {
-        return set(LOAD_LINE_NUMBERS, b);
+        return set(XmlOptionsKeys.LOAD_LINE_NUMBERS, b);
     }
 
     public boolean isLoadLineNumbers() {
-        return hasOption(LOAD_LINE_NUMBERS);
+        return hasOption(XmlOptionsKeys.LOAD_LINE_NUMBERS);
     }
 
 
@@ -769,11 +780,11 @@ public class XmlOptions implements java.
 
     public XmlOptions setLoadLineNumbersEndElement(boolean b) {
         setLoadLineNumbers(true);
-        return set(LOAD_LINE_NUMBERS_END_ELEMENT, b);
+        return set(XmlOptionsKeys.LOAD_LINE_NUMBERS_END_ELEMENT, b);
     }
 
     public boolean isLoadLineNumbersEndElement() {
-        return hasOption(LOAD_LINE_NUMBERS_END_ELEMENT);
+        return hasOption(XmlOptionsKeys.LOAD_LINE_NUMBERS_END_ELEMENT);
     }
 
     /**
@@ -796,12 +807,12 @@ public class XmlOptions implements java.
      * @see XmlObject.Factory#parse(java.io.File, XmlOptions)
      */
     public XmlOptions setLoadSubstituteNamespaces(Map<String, String> substNamespaces) {
-        return set(LOAD_SUBSTITUTE_NAMESPACES, substNamespaces);
+        return set(XmlOptionsKeys.LOAD_SUBSTITUTE_NAMESPACES, substNamespaces);
     }
 
     @SuppressWarnings("unchecked")
     public Map<String, String> getLoadSubstituteNamespaces() {
-        return (Map<String, String>) get(LOAD_SUBSTITUTE_NAMESPACES);
+        return (Map<String, String>) get(XmlOptionsKeys.LOAD_SUBSTITUTE_NAMESPACES);
     }
 
     /**
@@ -817,11 +828,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setLoadTrimTextBuffer(boolean b) {
-        return set(LOAD_TRIM_TEXT_BUFFER, b);
+        return set(XmlOptionsKeys.LOAD_TRIM_TEXT_BUFFER, b);
     }
 
     public boolean isLoadTrimTextBuffer() {
-        return hasOption(LOAD_TRIM_TEXT_BUFFER);
+        return hasOption(XmlOptionsKeys.LOAD_TRIM_TEXT_BUFFER);
     }
 
     /**
@@ -832,12 +843,12 @@ public class XmlOptions implements java.
      * @see XmlObject.Factory#parse(java.io.File, XmlOptions)
      */
     public XmlOptions setLoadAdditionalNamespaces(Map<String, String> nses) {
-        return set(LOAD_ADDITIONAL_NAMESPACES, nses);
+        return set(XmlOptionsKeys.LOAD_ADDITIONAL_NAMESPACES, nses);
     }
 
     @SuppressWarnings("unchecked")
     public Map<String, String> getLoadAdditionalNamespaces() {
-        return (Map<String, String>) get(LOAD_ADDITIONAL_NAMESPACES);
+        return (Map<String, String>) get(XmlOptionsKeys.LOAD_ADDITIONAL_NAMESPACES);
     }
 
     /**
@@ -856,11 +867,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setLoadMessageDigest(boolean b) {
-        return set(LOAD_MESSAGE_DIGEST, b);
+        return set(XmlOptionsKeys.LOAD_MESSAGE_DIGEST, b);
     }
 
     public boolean isLoadMessageDigest() {
-        return hasOption(LOAD_MESSAGE_DIGEST);
+        return hasOption(XmlOptionsKeys.LOAD_MESSAGE_DIGEST);
     }
 
     /**
@@ -875,11 +886,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setLoadUseDefaultResolver(boolean b) {
-        return set(LOAD_USE_DEFAULT_RESOLVER, b);
+        return set(XmlOptionsKeys.LOAD_USE_DEFAULT_RESOLVER, b);
     }
 
     public boolean isLoadUseDefaultResolver() {
-        return hasOption(LOAD_USE_DEFAULT_RESOLVER);
+        return hasOption(XmlOptionsKeys.LOAD_USE_DEFAULT_RESOLVER);
     }
 
 
@@ -892,11 +903,11 @@ public class XmlOptions implements java.
      * @see XmlObject.Factory#parse(java.io.File, XmlOptions)
      */
     public XmlOptions setLoadUseXMLReader(XMLReader xmlReader) {
-        return set(LOAD_USE_XMLREADER, xmlReader);
+        return set(XmlOptionsKeys.LOAD_USE_XMLREADER, xmlReader);
     }
 
     public XMLReader getLoadUseXMLReader() {
-        return (XMLReader) get(LOAD_USE_XMLREADER);
+        return (XMLReader) get(XmlOptionsKeys.LOAD_USE_XMLREADER);
     }
 
     /**
@@ -908,11 +919,11 @@ public class XmlOptions implements java.
      * @see XmlCursor#execQuery
      */
     public XmlOptions setXqueryCurrentNodeVar(String varName) {
-        return set(XQUERY_CURRENT_NODE_VAR, varName);
+        return set(XmlOptionsKeys.XQUERY_CURRENT_NODE_VAR, varName);
     }
 
     public String getXqueryCurrentNodeVar() {
-        return (String) get(XQUERY_CURRENT_NODE_VAR);
+        return (String) get(XmlOptionsKeys.XQUERY_CURRENT_NODE_VAR);
     }
 
     /**
@@ -928,12 +939,12 @@ public class XmlOptions implements java.
      * @see XmlCursor#execQuery
      */
     public XmlOptions setXqueryVariables(Map<String, Object> varMap) {
-        return set(XQUERY_VARIABLE_MAP, varMap);
+        return set(XmlOptionsKeys.XQUERY_VARIABLE_MAP, varMap);
     }
 
     @SuppressWarnings("unchecked")
     public Map<String, Object> getXqueryVariables() {
-        return (Map<String, Object>) get(XQUERY_VARIABLE_MAP);
+        return (Map<String, Object>) get(XmlOptionsKeys.XQUERY_VARIABLE_MAP);
     }
 
     /**
@@ -946,11 +957,11 @@ public class XmlOptions implements java.
      * @see XmlObject.Factory#parse(java.lang.String, XmlOptions)
      */
     public XmlOptions setDocumentSourceName(String documentSourceName) {
-        return set(DOCUMENT_SOURCE_NAME, documentSourceName);
+        return set(XmlOptionsKeys.DOCUMENT_SOURCE_NAME, documentSourceName);
     }
 
     public String getDocumentSourceName() {
-        return (String) get(DOCUMENT_SOURCE_NAME);
+        return (String) get(XmlOptionsKeys.DOCUMENT_SOURCE_NAME);
     }
 
     /**
@@ -960,12 +971,12 @@ public class XmlOptions implements java.
      * @see XmlBeans#compileXsd
      */
     public XmlOptions setCompileSubstituteNames(Map<QName, QName> nameMap) {
-        return set(COMPILE_SUBSTITUTE_NAMES, nameMap);
+        return set(XmlOptionsKeys.COMPILE_SUBSTITUTE_NAMES, nameMap);
     }
 
     @SuppressWarnings("unchecked")
     public Map<QName, QName> getCompileSubstituteNames() {
-        return (Map<QName, QName>) get(COMPILE_SUBSTITUTE_NAMES);
+        return (Map<QName, QName>) get(XmlOptionsKeys.COMPILE_SUBSTITUTE_NAMES);
     }
 
     /**
@@ -975,11 +986,11 @@ public class XmlOptions implements java.
      * @see XmlBeans#compileXsd
      */
     public XmlOptions setCompileNoValidation() {
-        return set(COMPILE_NO_VALIDATION);
+        return set(XmlOptionsKeys.COMPILE_NO_VALIDATION);
     }
 
     public boolean isCompileNoValidation() {
-        return hasOption(COMPILE_NO_VALIDATION);
+        return hasOption(XmlOptionsKeys.COMPILE_NO_VALIDATION);
     }
 
     /**
@@ -995,11 +1006,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setCompileNoUpaRule(boolean b) {
-        return set(COMPILE_NO_UPA_RULE, b);
+        return set(XmlOptionsKeys.COMPILE_NO_UPA_RULE, b);
     }
 
     public boolean isCompileNoUpaRule() {
-        return hasOption(COMPILE_NO_UPA_RULE);
+        return hasOption(XmlOptionsKeys.COMPILE_NO_UPA_RULE);
     }
 
     /**
@@ -1015,11 +1026,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setCompileNoPvrRule(boolean b) {
-        return set(COMPILE_NO_PVR_RULE, b);
+        return set(XmlOptionsKeys.COMPILE_NO_PVR_RULE, b);
     }
 
     public boolean isCompileNoPvrRule() {
-        return hasOption(COMPILE_NO_PVR_RULE);
+        return hasOption(XmlOptionsKeys.COMPILE_NO_PVR_RULE);
     }
 
     /**
@@ -1033,11 +1044,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setCompileNoAnnotations(boolean b) {
-        return set(COMPILE_NO_ANNOTATIONS, b);
+        return set(XmlOptionsKeys.COMPILE_NO_ANNOTATIONS, b);
     }
 
     public boolean isCompileNoAnnotations() {
-        return hasOption(COMPILE_NO_ANNOTATIONS);
+        return hasOption(XmlOptionsKeys.COMPILE_NO_ANNOTATIONS);
     }
 
     /**
@@ -1051,11 +1062,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setCompileDownloadUrls(boolean b) {
-        return set(COMPILE_DOWNLOAD_URLS, b);
+        return set(XmlOptionsKeys.COMPILE_DOWNLOAD_URLS, b);
     }
 
     public boolean isCompileDownloadUrls() {
-        return hasOption(COMPILE_DOWNLOAD_URLS);
+        return hasOption(XmlOptionsKeys.COMPILE_DOWNLOAD_URLS);
     }
 
     /**
@@ -1069,12 +1080,25 @@ public class XmlOptions implements java.
      * @see XmlBeans#compileXsd
      */
     public XmlOptions setCompileMdefNamespaces(Set<String> mdefNamespaces) {
-        return set(COMPILE_MDEF_NAMESPACES, mdefNamespaces);
+        return set(XmlOptionsKeys.COMPILE_MDEF_NAMESPACES, mdefNamespaces);
     }
 
     @SuppressWarnings("unchecked")
     public Set<String> getCompileMdefNamespaces() {
-        return (Set<String>) get(COMPILE_MDEF_NAMESPACES);
+        return (Set<String>) get(XmlOptionsKeys.COMPILE_MDEF_NAMESPACES);
+    }
+
+    public XmlOptions setCompilePartialTypesystem() {
+        return setCompilePartialTypesystem(true);
+    }
+
+    public XmlOptions setCompilePartialTypesystem(boolean compilePartialTypesystem) {
+        return set(XmlOptionsKeys.COMPILE_PARTIAL_TYPESYSTEM, compilePartialTypesystem);
+    }
+
+    public boolean isCompilePartialTypesystem() {
+        Boolean flag = (Boolean) get(XmlOptionsKeys.COMPILE_PARTIAL_TYPESYSTEM);
+        return flag != null && flag;
     }
 
     /**
@@ -1093,11 +1117,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setValidateOnSet(boolean b) {
-        return set(VALIDATE_ON_SET, b);
+        return set(XmlOptionsKeys.VALIDATE_ON_SET, b);
     }
 
     public boolean isValidateOnSet() {
-        return hasOption(VALIDATE_ON_SET);
+        return hasOption(XmlOptionsKeys.VALIDATE_ON_SET);
     }
 
     /**
@@ -1111,11 +1135,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setValidateTreatLaxAsSkip(boolean b) {
-        return set(VALIDATE_TREAT_LAX_AS_SKIP, b);
+        return set(XmlOptionsKeys.VALIDATE_TREAT_LAX_AS_SKIP, b);
     }
 
     public boolean isValidateTreatLaxAsSkip() {
-        return hasOption(VALIDATE_TREAT_LAX_AS_SKIP);
+        return hasOption(XmlOptionsKeys.VALIDATE_TREAT_LAX_AS_SKIP);
     }
 
     /**
@@ -1127,11 +1151,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setValidateStrict(boolean b) {
-        return set(VALIDATE_STRICT, b);
+        return set(XmlOptionsKeys.VALIDATE_STRICT, b);
     }
 
     public boolean isValidateStrict() {
-        return hasOption(VALIDATE_STRICT);
+        return hasOption(XmlOptionsKeys.VALIDATE_STRICT);
     }
 
     public XmlOptions setValidateTextOnly() {
@@ -1139,11 +1163,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setValidateTextOnly(boolean b) {
-        return set(VALIDATE_TEXT_ONLY, b);
+        return set(XmlOptionsKeys.VALIDATE_TEXT_ONLY, b);
     }
 
     public boolean isValidateTextOnly() {
-        return hasOption(VALIDATE_TEXT_ONLY);
+        return hasOption(XmlOptionsKeys.VALIDATE_TEXT_ONLY);
     }
 
 
@@ -1159,11 +1183,11 @@ public class XmlOptions implements java.
     }
 
     public XmlOptions setUnsynchronized(boolean b) {
-        return set(UNSYNCHRONIZED, b);
+        return set(XmlOptionsKeys.UNSYNCHRONIZED, b);
     }
 
     public boolean isUnsynchronized() {
-        return hasOption(UNSYNCHRONIZED);
+        return hasOption(XmlOptionsKeys.UNSYNCHRONIZED);
     }
 
     /**
@@ -1178,11 +1202,11 @@ public class XmlOptions implements java.
      * @see XmlBeans#compileXsd
      */
     public XmlOptions setEntityResolver(EntityResolver resolver) {
-        return set(ENTITY_RESOLVER, resolver);
+        return set(XmlOptionsKeys.ENTITY_RESOLVER, resolver);
     }
 
     public EntityResolver getEntityResolver() {
-        return (EntityResolver) get(ENTITY_RESOLVER);
+        return (EntityResolver) get(XmlOptionsKeys.ENTITY_RESOLVER);
     }
 
     /**
@@ -1194,11 +1218,11 @@ public class XmlOptions implements java.
      * @see XmlBeans#compileXsd
      */
     public XmlOptions setBaseURI(URI baseURI) {
-        return set(BASE_URI, baseURI);
+        return set(XmlOptionsKeys.BASE_URI, baseURI);
     }
 
     public URI getBaseURI() {
-        return (URI) get(BASE_URI);
+        return (URI) get(XmlOptionsKeys.BASE_URI);
     }
 
     /**
@@ -1209,11 +1233,11 @@ public class XmlOptions implements java.
      * @see XmlBeans#compileXsd
      */
     public XmlOptions setSchemaCodePrinter(SchemaCodePrinter printer) {
-        return set(SCHEMA_CODE_PRINTER, printer);
+        return set(XmlOptionsKeys.SCHEMA_CODE_PRINTER, printer);
     }
 
     public SchemaCodePrinter getSchemaCodePrinter() {
-        return (SchemaCodePrinter) get(SCHEMA_CODE_PRINTER);
+        return (SchemaCodePrinter) get(XmlOptionsKeys.SCHEMA_CODE_PRINTER);
     }
 
     /**
@@ -1228,11 +1252,11 @@ public class XmlOptions implements java.
      * @see XmlBeans#compileXmlBeans
      */
     public XmlOptions setGenerateJavaVersion(String source) {
-        return set(GENERATE_JAVA_VERSION, source);
+        return set(XmlOptionsKeys.GENERATE_JAVA_VERSION, source);
     }
 
     public String getGenerateJavaVersion() {
-        return (String) get(GENERATE_JAVA_VERSION);
+        return (String) get(XmlOptionsKeys.GENERATE_JAVA_VERSION);
     }
 
     /**
@@ -1245,14 +1269,23 @@ public class XmlOptions implements java.
      * @see XmlObject#copy()
      */
     public XmlOptions setCopyUseNewSynchronizationDomain(boolean useNewSyncDomain) {
-        return set(COPY_USE_NEW_SYNC_DOMAIN, useNewSyncDomain);
+        return set(XmlOptionsKeys.COPY_USE_NEW_SYNC_DOMAIN, useNewSyncDomain);
     }
 
     public boolean isCopyUseNewSynchronizationDomain() {
-        Boolean flag = (Boolean)get(COPY_USE_NEW_SYNC_DOMAIN);
+        Boolean flag = (Boolean)get(XmlOptionsKeys.COPY_USE_NEW_SYNC_DOMAIN);
         return flag != null && flag;
     }
 
+    public XmlOptions setUseSameLocale(Object localeOrXmlTokenSource) {
+        return set(XmlOptionsKeys.USE_SAME_LOCALE, localeOrXmlTokenSource);
+    }
+
+    public Object getUseSameLocale() {
+        return get(XmlOptionsKeys.USE_SAME_LOCALE);
+    }
+
+
     /**
      * Sets the maximum number of bytes allowed when an Entity is expanded during parsing.
      * The default value is 10240 bytes.
@@ -1261,11 +1294,11 @@ public class XmlOptions implements java.
      * @return this
      */
     public XmlOptions setLoadEntityBytesLimit(int entityBytesLimit) {
-        return set(LOAD_ENTITY_BYTES_LIMIT, entityBytesLimit);
+        return set(XmlOptionsKeys.LOAD_ENTITY_BYTES_LIMIT, entityBytesLimit);
     }
 
     public Integer getLoadEntityBytesLimit() {
-        return (Integer) get(LOAD_ENTITY_BYTES_LIMIT);
+        return (Integer) get(XmlOptionsKeys.LOAD_ENTITY_BYTES_LIMIT);
     }
 
 
@@ -1277,11 +1310,11 @@ public class XmlOptions implements java.
      * @return this
      */
     public XmlOptions setEntityExpansionLimit(int entityExpansionLimit) {
-        return set(ENTITY_EXPANSION_LIMIT, entityExpansionLimit);
+        return set(XmlOptionsKeys.ENTITY_EXPANSION_LIMIT, entityExpansionLimit);
     }
 
     public int getEntityExpansionLimit() {
-        Integer limit = (Integer) get(ENTITY_EXPANSION_LIMIT);
+        Integer limit = (Integer) get(XmlOptionsKeys.ENTITY_EXPANSION_LIMIT);
         return limit == null ? DEFAULT_ENTITY_EXPANSION_LIMIT : limit;
     }
 
@@ -1293,11 +1326,11 @@ public class XmlOptions implements java.
      * @return this
      */
     public XmlOptions setLoadDTDGrammar(boolean loadDTDGrammar) {
-        return set(LOAD_DTD_GRAMMAR, loadDTDGrammar);
+        return set(XmlOptionsKeys.LOAD_DTD_GRAMMAR, loadDTDGrammar);
     }
 
     public boolean isLoadDTDGrammar() {
-        Boolean flag = (Boolean) get(LOAD_DTD_GRAMMAR);
+        Boolean flag = (Boolean) get(XmlOptionsKeys.LOAD_DTD_GRAMMAR);
         return flag != null && flag;
     }
 
@@ -1309,67 +1342,98 @@ public class XmlOptions implements java.
      * @return this
      */
     public XmlOptions setLoadExternalDTD(boolean loadExternalDTD) {
-        return set(LOAD_EXTERNAL_DTD, loadExternalDTD);
+        return set(XmlOptionsKeys.LOAD_EXTERNAL_DTD, loadExternalDTD);
     }
 
     public boolean isLoadExternalDTD() {
-        Boolean flag = (Boolean) get(LOAD_EXTERNAL_DTD);
+        Boolean flag = (Boolean) get(XmlOptionsKeys.LOAD_EXTERNAL_DTD);
         return flag != null && flag;
     }
 
     public XmlOptions setSaveOptimizeForSpeed(boolean saveOptimizeForSpeed) {
-        return set(SAVE_OPTIMIZE_FOR_SPEED, saveOptimizeForSpeed);
+        return set(XmlOptionsKeys.SAVE_OPTIMIZE_FOR_SPEED, saveOptimizeForSpeed);
     }
 
     public boolean isSaveOptimizeForSpeed() {
-        Boolean flag = (Boolean) get(SAVE_OPTIMIZE_FOR_SPEED);
+        Boolean flag = (Boolean) get(XmlOptionsKeys.SAVE_OPTIMIZE_FOR_SPEED);
         return flag != null && flag;
     }
 
+    // Use in XmlOptions to enable SAAJ support in store
+    public XmlOptions setSaaj(Saaj saaj) {
+        return set(XmlOptionsKeys.SAAJ_IMPL, saaj);
+    }
 
-    /**
-     * If passed null, returns an empty options object.  Otherwise, returns its argument.
-     */
-    public static XmlOptions maskNull(XmlOptions o) {
-        return (o == null) ? EMPTY_OPTIONS : o;
+    public Saaj getSaaj() {
+        return (Saaj)get(XmlOptionsKeys.SAAJ_IMPL);
     }
 
+    public XmlOptions setLoadUseLocaleCharUtil(boolean useCharUtil) {
+        return set(XmlOptionsKeys.LOAD_USE_LOCALE_CHAR_UTIL, useCharUtil);
+    }
 
-    /**
-     * Used to set a generic option
-     */
-    public void put(String option) {
-        put(option, null);
+    public boolean isLoadUseLocaleCharUtil() {
+        Boolean flag = (Boolean) get(XmlOptionsKeys.LOAD_USE_LOCALE_CHAR_UTIL);
+        return flag != null && flag;
     }
 
-    /**
-     * Used to set a generic option
-     */
-    public void put(String option, Object value) {
-        _map.put(option, value);
+    public XmlOptions setXPathUseDelegate() {
+        return setXPathUseDelegate(true);
+    }
+
+    public XmlOptions setXPathUseDelegate(boolean xpathUseDelegate) {
+        return set(XmlOptionsKeys.XPATH_USE_DELEGATE, xpathUseDelegate);
+    }
+
+    public boolean isXPathUseDelegate() {
+        Boolean flag = (Boolean)get(XmlOptionsKeys.XPATH_USE_DELEGATE);
+        return flag != null && flag;
+    }
+
+    public XmlOptions setXPathUseXmlBeans() {
+        return setXPathUseDelegate(true);
+    }
+
+    public XmlOptions setXPathUseXmlBeans(boolean xpathUseDelegate) {
+        return set(XmlOptionsKeys.XPATH_USE_XMLBEANS, xpathUseDelegate);
+    }
+
+    public boolean isXPathUseXmlBeans() {
+        Boolean flag = (Boolean)get(XmlOptionsKeys.XPATH_USE_XMLBEANS);
+        return flag != null && flag;
+    }
+
+    public XmlOptions setAttributeValidationCompatMode(boolean attributeValidationCompatMode) {
+        return set(XmlOptionsKeys.ATTTRIBUTE_VALIDATION_COMPAT_MODE, attributeValidationCompatMode);
+    }
+
+    public boolean isAttributeValidationCompatMode() {
+        Boolean flag = (Boolean)get(XmlOptionsKeys.ATTTRIBUTE_VALIDATION_COMPAT_MODE);
+        return flag != null && flag;
     }
 
     /**
-     * Used to set a generic option
+     * If passed null, returns an empty options object.  Otherwise, returns its argument.
      */
-    public void put(String option, int value) {
-        put(option, new Integer(value));
+    public static XmlOptions maskNull(XmlOptions o) {
+        return (o == null) ? EMPTY_OPTIONS : o;
     }
 
-    private XmlOptions set(String option) {
-        return set(option, null);
+
+    private XmlOptions set(XmlOptionsKeys option) {
+        return set(option, true);
     }
 
-    private XmlOptions set(String option, Object value) {
+    private XmlOptions set(XmlOptionsKeys option, Object value) {
         _map.put(option, value);
         return this;
     }
 
-    private XmlOptions set(String option, int value) {
+    private XmlOptions set(XmlOptionsKeys option, int value) {
         return set(option, new Integer(value));
     }
 
-    private XmlOptions set(String option, boolean value) {
+    private XmlOptions set(XmlOptionsKeys option, boolean value) {
         if (value) {
             set(option, Boolean.TRUE);
         } else {
@@ -1381,30 +1445,18 @@ public class XmlOptions implements java.
     /**
      * Used to test a generic option
      */
-    public boolean hasOption(String option) {
+    public boolean hasOption(XmlOptionsKeys option) {
         return _map.containsKey(option);
     }
 
-    public static boolean hasOption(XmlOptions options, String option) {
-        return options != null && options.hasOption(option);
-    }
-
     /**
      * Used to get a generic option
      */
-    public Object get(String option) {
+    public Object get(XmlOptionsKeys option) {
         return _map.get(option);
     }
 
-    public void remove(String option) {
+    public void remove(XmlOptionsKeys option) {
         _map.remove(option);
     }
-
-    /**
-     * Used to test a generic option on an options object that may be null
-     */
-    public static Object safeGet(XmlOptions o, String option) {
-        return o == null ? null : o.get(option);
-    }
-
 }

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscState.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscState.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscState.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/schema/StscState.java Tue Sep  1 22:25:35 2020
@@ -448,7 +448,7 @@ public class StscState {
             return; // defaults are all false.
         }
 
-        _allowPartial = options.hasOption("COMPILE_PARTIAL_TYPESYSTEM");
+        _allowPartial = options.isCompilePartialTypesystem();
 
         _compatMap = options.getCompileSubstituteNames();
         _noUpa = options.isCompileNoUpaRule() ||

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Cur.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Cur.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Cur.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Cur.java Tue Sep  1 22:25:35 2020
@@ -2695,8 +2695,6 @@ final class Cur {
         return isOnList(_locale._registered);
     }
 
-    static final String LOAD_USE_LOCALE_CHAR_UTIL = "LOAD_USE_LOCALE_CHAR_UTIL";
-
     static final class CurLoadContext extends LoadContext {
         CurLoadContext(Locale l, XmlOptions options) {
             options = XmlOptions.maskNull(options);
@@ -2704,7 +2702,7 @@ final class Cur {
             _locale = l;
 
             _charUtil =
-                options.hasOption(LOAD_USE_LOCALE_CHAR_UTIL)
+                options.isLoadUseLocaleCharUtil()
                     ? _locale.getCharUtil()
                     : CharUtil.getThreadLocalCharUtil();
 
@@ -2715,7 +2713,7 @@ final class Cur {
             _lastPos = 0;
 
             _replaceDocElem = options.getLoadReplaceDocumentElement();
-            _discardDocElem = options.hasOption(XmlOptions.LOAD_REPLACE_DOCUMENT_ELEMENT);
+            _discardDocElem = options.hasOption(XmlOptions.XmlOptionsKeys.LOAD_REPLACE_DOCUMENT_ELEMENT);
 
             _stripWhitespace = options.isSetLoadStripWhitespace();
             _stripComments = options.isLoadStripComments();

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Locale.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Locale.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Locale.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Locale.java Tue Sep  1 22:25:35 2020
@@ -109,15 +109,9 @@ public final class Locale
         // Check for Saaj implementation request
         //
 
-        Object saajObj = options.get(Saaj.SAAJ_IMPL);
+        _saaj = options.getSaaj();
 
-        if (saajObj != null) {
-            if (!(saajObj instanceof Saaj)) {
-                throw new IllegalStateException(
-                    "Saaj impl not correct type: " + saajObj);
-            }
-
-            _saaj = (Saaj) saajObj;
+        if (_saaj != null) {
 
             _saaj.setCallback(this);
         }
@@ -127,16 +121,6 @@ public final class Locale
     //
     //
 
-    public static final String USE_SAME_LOCALE = "USE_SAME_LOCALE";
-    /**
-     * This option is checked in XmlObjectBase._copy(XmlOptions), the locale is used as the synchronization domain.
-     * useNewLocale = true: copy will use a new locale, false: copy will use the same locale as the source
-     *
-     * @see org.apache.xmlbeans.XmlOptions#setCopyUseNewSynchronizationDomain(boolean)
-     * @deprecated Replace usages with CopyUseNewSynchronizationDomain option
-     */
-    public static final String COPY_USE_NEW_LOCALE = "COPY_USE_NEW_LOCALE";
-
     static Locale getLocale(SchemaTypeLoader stl, XmlOptions options) {
         if (stl == null) {
             stl = XmlBeans.getContextTypeLoader();
@@ -144,10 +128,13 @@ public final class Locale
 
         options = XmlOptions.maskNull(options);
 
-        Locale l = null;
+        if (options.getUseSameLocale() == null) {
+            return new Locale(stl, options);
+        }
+
+        Object source = options.getUseSameLocale();
 
-        if (options.hasOption(USE_SAME_LOCALE)) {
-            Object source = options.get(USE_SAME_LOCALE);
+        Locale l;
 
             if (source instanceof Locale) {
                 l = (Locale) source;
@@ -163,7 +150,7 @@ public final class Locale
                     "Source locale does not support same schema type loader");
             }
 
-            if (l._saaj != null && l._saaj != options.get(Saaj.SAAJ_IMPL)) {
+        if (l._saaj != null && l._saaj != options.getSaaj()) {
                 throw new IllegalArgumentException(
                     "Source locale does not support same saaj");
             }
@@ -174,9 +161,6 @@ public final class Locale
             }
 
             // TODO - other things to check?
-        } else {
-            l = new Locale(stl, options);
-        }
 
         return l;
     }
@@ -1295,7 +1279,7 @@ public final class Locale
             // to use the Locale specific CharUtil.
 
             XmlOptions saxHandlerOptions = new XmlOptions(options);
-            saxHandlerOptions.put(Cur.LOAD_USE_LOCALE_CHAR_UTIL);
+            saxHandlerOptions.setLoadUseLocaleCharUtil(true);
 
             initSaxHandler(l, saxHandlerOptions);
         }

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Path.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Path.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Path.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Path.java Tue Sep  1 22:25:35 2020
@@ -20,6 +20,7 @@ import org.apache.xmlbeans.impl.common.D
 import org.apache.xmlbeans.impl.common.XPath;
 import org.apache.xmlbeans.impl.common.XPath.XPathCompileException;
 import org.apache.xmlbeans.impl.common.XPathExecutionContext;
+import org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath;
 import org.w3c.dom.Node;
 
 import java.io.BufferedReader;
@@ -40,50 +41,15 @@ import java.util.concurrent.locks.Reentr
 public abstract class Path {
     public static final String PATH_DELEGATE_INTERFACE = "PATH_DELEGATE_INTERFACE";
     public static String _useDelegateForXpath = "use delegate for xpath";
-    public static String _useXdkForXpath = "use xdk for xpath";
-    public static String _useXqrlForXpath = "use xqrl for xpath";
     public static String _useXbeanForXpath = "use xbean for xpath";
-    public static String _forceXqrl2002ForXpathXQuery = "use xqrl-2002 for xpath";
 
     private static final int USE_XBEAN = 0x01;
-    private static final int USE_XQRL = 0x02;
     private static final int USE_DELEGATE = 0x04;
-    private static final int USE_XQRL2002 = 0x08;
-    private static final int USE_XDK = 0x10;
 
     private static final Map<String, WeakReference<Path>> _xbeanPathCache = new WeakHashMap<>();
-    private static final Map<String, WeakReference<Path>> _xdkPathCache = new WeakHashMap<>();
-    private static final Map<String, WeakReference<Path>> _xqrlPathCache = new WeakHashMap<>();
-    private static final Map<String, WeakReference<Path>> _xqrl2002PathCache = new WeakHashMap<>();
-
-    private static Method _xdkCompilePath;
-    private static Method _xqrlCompilePath;
-    private static Method _xqrl2002CompilePath;
-
-    private static boolean _xdkAvailable = true;
-    private static boolean _xqrlAvailable = true;
-    private static boolean _xqrl2002Available = true;
 
-    private static final String _delIntfName;
-    private static final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-
-    static {
-        String id = "META-INF/services/org.apache.xmlbeans.impl.store.PathDelegate.SelectPathInterface";
-        InputStream in = new DefaultClassLoaderResourceLoader().getResourceAsStream(id);
-
-        String name = null;
-        if (in != null) {
-            try {
-                BufferedReader br = new BufferedReader(new InputStreamReader(in));
-                name = br.readLine().trim();
-                br.close();
-            } catch (Exception e) {
-                // set nothing
-            }
-        }
 
-        _delIntfName = name;
-    }
+    private static final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
 
     protected final String _pathKey;
 
@@ -125,15 +91,10 @@ public abstract class Path {
         options = XmlOptions.maskNull(options);
 
         int force =
-            options.hasOption(_useDelegateForXpath) ? USE_DELEGATE
-                : options.hasOption(_useXqrlForXpath) ? USE_XQRL
-                : options.hasOption(_useXdkForXpath) ? USE_XDK
-                : options.hasOption(_useXbeanForXpath) ? USE_XBEAN
-                : options.hasOption(_forceXqrl2002ForXpathXQuery) ? USE_XQRL2002
-                : USE_XBEAN | USE_XQRL | USE_XDK | USE_DELEGATE; //set all bits except XQRL2002
-        String delIntfName =
-            options.hasOption(PATH_DELEGATE_INTERFACE) ?
-                (String) options.get(PATH_DELEGATE_INTERFACE) : _delIntfName;
+            options.isXPathUseDelegate() ? USE_DELEGATE
+                : options.isXPathUseXmlBeans() ? USE_XBEAN
+                : USE_XBEAN | USE_DELEGATE;
+        String delIntfName = XBeansXPath.class.getName();
 
         return getCompiledPath(pathExpr, force, getCurrentNodeVar(options), delIntfName);
     }
@@ -148,15 +109,6 @@ public abstract class Path {
             if ((force & USE_XBEAN) != 0) {
                 pathWeakRef = _xbeanPathCache.get(pathExpr);
             }
-            if (pathWeakRef == null && (force & USE_XQRL) != 0) {
-                pathWeakRef = _xqrlPathCache.get(pathExpr);
-            }
-            if (pathWeakRef == null && (force & USE_XDK) != 0) {
-                pathWeakRef = _xdkPathCache.get(pathExpr);
-            }
-            if (pathWeakRef == null && (force & USE_XQRL2002) != 0) {
-                pathWeakRef = _xqrl2002PathCache.get(pathExpr);
-            }
 
             if (pathWeakRef != null) {
                 path = pathWeakRef.get();
@@ -178,53 +130,17 @@ public abstract class Path {
                     path = getCompiledPathXbean(pathExpr, currentVar, namespaces);
                 }
             }
-            if (path == null && (force & USE_XQRL) != 0) {
-                pathWeakRef = _xqrlPathCache.get(pathExpr);
-                if (pathWeakRef != null) {
-                    path = pathWeakRef.get();
-                }
-                if (path == null) {
-                    path = getCompiledPathXqrl(pathExpr, currentVar);
-                }
-            }
-            if (path == null && (force & USE_XDK) != 0) {
-                pathWeakRef = _xdkPathCache.get(pathExpr);
-                if (pathWeakRef != null) {
-                    path = pathWeakRef.get();
-                }
-                if (path == null) {
-                    path = getCompiledPathXdk(pathExpr, currentVar);
-                }
-            }
             if (path == null && (force & USE_DELEGATE) != 0) {
                 path = getCompiledPathDelegate(pathExpr, currentVar, namespaces, delIntfName);
             }
-            if (path == null && (force & USE_XQRL2002) != 0) {
-                pathWeakRef = _xqrl2002PathCache.get(pathExpr);
-                if (pathWeakRef != null) {
-                    path = pathWeakRef.get();
-                }
-                if (path == null) {
-                    path = getCompiledPathXqrl2002(pathExpr, currentVar);
-                }
-            }
             if (path == null) {
                 StringBuilder errMessage = new StringBuilder();
                 if ((force & USE_XBEAN) != 0) {
                     errMessage.append(" Trying XBeans path engine...");
                 }
-                if ((force & USE_XQRL) != 0) {
-                    errMessage.append(" Trying XQRL...");
-                }
-                if ((force & USE_XDK) != 0) {
-                    errMessage.append(" Trying XDK...");
-                }
                 if ((force & USE_DELEGATE) != 0) {
                     errMessage.append(" Trying delegated path engine...");
                 }
-                if ((force & USE_XQRL2002) != 0) {
-                    errMessage.append(" Trying XQRL2002...");
-                }
 
                 throw new RuntimeException(errMessage.toString() + " FAILED on " + pathExpr);
             }
@@ -234,33 +150,6 @@ public abstract class Path {
         return path;
     }
 
-    static private Path getCompiledPathXdk(String pathExpr, String currentVar) {
-        Path path = createXdkCompiledPath(pathExpr, currentVar);
-        if (path != null) {
-            _xdkPathCache.put(path._pathKey, new WeakReference<>(path));
-        }
-
-        return path;
-    }
-
-    static private Path getCompiledPathXqrl(String pathExpr, String currentVar) {
-        Path path = createXqrlCompiledPath(pathExpr, currentVar);
-        if (path != null) {
-            _xqrlPathCache.put(path._pathKey, new WeakReference<>(path));
-        }
-
-        return path;
-    }
-
-    static private Path getCompiledPathXqrl2002(String pathExpr, String currentVar) {
-        Path path = createXqrl2002CompiledPath(pathExpr, currentVar);
-        if (path != null) {
-            _xqrl2002PathCache.put(path._pathKey, new WeakReference<>(path));
-        }
-
-        return path;
-    }
-
     static private Path getCompiledPathXbean(String pathExpr,
                                              String currentVar, Map<String, String> namespaces) {
         Path path = XbeanPath.create(pathExpr, currentVar, namespaces);
@@ -320,9 +209,7 @@ public abstract class Path {
 
         PathEngine execute(Cur c, XmlOptions options) {
             options = XmlOptions.maskNull(options);
-            String delIntfName =
-                options.hasOption(PATH_DELEGATE_INTERFACE) ?
-                    (String) options.get(PATH_DELEGATE_INTERFACE) : _delIntfName;
+            String delIntfName = XBeansXPath.class.getName();
 
             // The builtin XPath engine works only on containers.  Delegate to
             // xqrl otherwise.  Also, if the path had a //. at the end, the
@@ -330,7 +217,7 @@ public abstract class Path {
             // attrs and elements.
 
             if (!c.isContainer() || _compiledPath.sawDeepDot()) {
-                int force = USE_DELEGATE | USE_XQRL | USE_XDK;
+                int force = USE_DELEGATE;
                 return getCompiledPath(_pathKey, force, _currentVar, delIntfName).execute(c, options);
             }
             return new XbeanPathEngine(_compiledPath, c);
@@ -341,105 +228,6 @@ public abstract class Path {
         public Map<String, String> namespaces;
     }
 
-    private static Path createXdkCompiledPath(String pathExpr, String currentVar) {
-        if (!_xdkAvailable) {
-            return null;
-        }
-
-        if (_xdkCompilePath == null) {
-            try {
-                Class xdkImpl = Class.forName("org.apache.xmlbeans.impl.store.OXQXBXqrlImpl");
-
-                _xdkCompilePath =
-                    xdkImpl.getDeclaredMethod("compilePath",
-                        new Class[]{String.class, String.class, Boolean.class});
-            } catch (ClassNotFoundException e) {
-                _xdkAvailable = false;
-                return null;
-            } catch (Exception e) {
-                _xdkAvailable = false;
-                throw new RuntimeException(e.getMessage(), e);
-            }
-        }
-
-        Object[] args = new Object[]{pathExpr, currentVar, Boolean.TRUE};
-
-        try {
-            return (Path) _xdkCompilePath.invoke(null, args);
-        } catch (InvocationTargetException e) {
-            Throwable t = e.getCause();
-            throw new RuntimeException(t.getMessage(), t);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage(), e);
-        }
-    }
-
-    private static Path createXqrlCompiledPath(String pathExpr, String currentVar) {
-        if (!_xqrlAvailable) {
-            return null;
-        }
-
-        if (_xqrlCompilePath == null) {
-            try {
-                Class xqrlImpl = Class.forName("org.apache.xmlbeans.impl.store.XqrlImpl");
-
-                _xqrlCompilePath =
-                    xqrlImpl.getDeclaredMethod("compilePath",
-                        new Class[]{String.class, String.class, Boolean.class});
-            } catch (ClassNotFoundException e) {
-                _xqrlAvailable = false;
-                return null;
-            } catch (Exception e) {
-                _xqrlAvailable = false;
-                throw new RuntimeException(e.getMessage(), e);
-            }
-        }
-
-        Object[] args = new Object[]{pathExpr, currentVar, Boolean.TRUE};
-
-        try {
-            return (Path) _xqrlCompilePath.invoke(null, args);
-        } catch (InvocationTargetException e) {
-            Throwable t = e.getCause();
-            throw new RuntimeException(t.getMessage(), t);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage(), e);
-        }
-    }
-
-    private static Path createXqrl2002CompiledPath(String pathExpr, String currentVar) {
-        if (!_xqrl2002Available) {
-            return null;
-        }
-
-        if (_xqrl2002CompilePath == null) {
-            try {
-                Class xqrlImpl = Class.forName("org.apache.xmlbeans.impl.store.Xqrl2002Impl");
-
-                _xqrl2002CompilePath =
-                    xqrlImpl.getDeclaredMethod("compilePath",
-                        new Class[]{String.class, String.class, Boolean.class});
-            } catch (ClassNotFoundException e) {
-                _xqrl2002Available = false;
-                return null;
-            } catch (Exception e) {
-                _xqrl2002Available = false;
-                throw new RuntimeException(e.getMessage(), e);
-            }
-        }
-
-        Object[] args = new Object[]{pathExpr, currentVar, Boolean.TRUE};
-
-        try {
-            return (Path) _xqrl2002CompilePath.invoke(null, args);
-        } catch (InvocationTargetException e) {
-            Throwable t = e.getCause();
-            throw new RuntimeException(t.getMessage(), t);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage(), e);
-        }
-    }
-
     private static final class XbeanPathEngine
         extends XPathExecutionContext
         implements PathEngine {

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Public2.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Public2.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Public2.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Public2.java Tue Sep  1 22:25:35 2020
@@ -61,7 +61,7 @@ public final class Public2
         if (saaj != null)
         {
             options = new XmlOptions();
-            options.put( org.apache.xmlbeans.impl.store.Saaj.SAAJ_IMPL, saaj );
+            options.setSaaj(saaj);
         }
 
         return Locale.getLocale( null, options );
@@ -300,7 +300,7 @@ public final class Public2
         Node n = xc.getDomNode();
         Dom d = (Dom) n;
         xc.dispose();
-        
+
         dump( o, d );
     }
 
@@ -342,7 +342,7 @@ public final class Public2
     public static void test ( ) throws Exception
     {
         Xobj x = (Xobj) Public2.parse( "<a>XY</a>" );
-        
+
         Locale l = x._locale;
 
         l.enter();
@@ -352,20 +352,20 @@ public final class Public2
             Cur c = x.tempCur();
 
             c.next();
-            
+
             Cur c2 = c.tempCur();
             c2.next();
-            
+
             Cur c3 = c2.tempCur();
             c3.nextChars( 1 );
-            
+
             Cur c4 = c3.tempCur();
             c4.nextChars( 1 );
 
             c.dump();
-            
+
             c.moveNodeContents( c, true );
-            
+
             c.dump();
         }
         catch ( Throwable e )

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Query.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Query.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Query.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Query.java Tue Sep  1 22:25:35 2020
@@ -18,6 +18,7 @@ package org.apache.xmlbeans.impl.store;
 import org.apache.xmlbeans.*;
 import org.apache.xmlbeans.impl.common.DefaultClassLoaderResourceLoader;
 import org.apache.xmlbeans.impl.common.XPath;
+import org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery;
 import org.w3c.dom.Node;
 
 import javax.xml.namespace.QName;
@@ -35,34 +36,7 @@ import java.util.Map;
 public abstract class Query {
     public static final String QUERY_DELEGATE_INTERFACE = "QUERY_DELEGATE_INTERFACE";
     public static String _useDelegateForXQuery = "use delegate for xquery";
-    public static String _useXdkForXQuery = "use xdk for xquery";
 
-    private static String _delIntfName;
-    //private static HashMap _delegateQueryCache = new HashMap();
-
-    private static HashMap _xdkQueryCache = new HashMap();
-    private static Method _xdkCompileQuery;
-    private static boolean _xdkAvailable = true;  // at the beginning assume is available
-
-    private static HashMap _xqrlQueryCache = new HashMap(); //todo check for memory leaks
-    private static Method _xqrlCompileQuery;
-    private static boolean _xqrlAvailable = true;  // at the beginning assume is available
-
-    private static HashMap _xqrl2002QueryCache = new HashMap();
-    private static Method _xqrl2002CompileQuery;
-    private static boolean _xqrl2002Available = true;  // at the beginning assume is available
-
-    static {
-        String id = "META-INF/services/org.apache.xmlbeans.impl.store.QueryDelegate.QueryInterface";
-        InputStream in = new DefaultClassLoaderResourceLoader().getResourceAsStream(id);
-        try {
-            BufferedReader br = new BufferedReader(new InputStreamReader(in));
-            _delIntfName = br.readLine().trim();
-            br.close();
-        } catch (Exception e) {
-            _delIntfName = null;
-        }
-    }
 
     abstract XmlObject[] objectExecute(Cur c, XmlOptions options);
 
@@ -89,20 +63,6 @@ public abstract class Query {
         options = XmlOptions.maskNull(options);
         Query query;
 
-        if (options.hasOption(Path._forceXqrl2002ForXpathXQuery)) {
-            query = (Query) _xqrl2002QueryCache.get(queryExpr);
-            if (query != null) {
-                return query;
-            }
-
-            query = getXqrl2002CompiledQuery(queryExpr, currentVar);
-            if (query != null) {
-                _xqrl2002QueryCache.put(queryExpr, query);
-                return query;
-            }
-            throw new RuntimeException("No 2002 query engine found.");
-        }
-
         //Parse the query via XBeans: need to figure out end of prolog
         //in order to bind $this...not good but...
         Map<String, String> boundary = new HashMap<>();
@@ -115,44 +75,8 @@ public abstract class Query {
             boundaryVal = Integer.parseInt(boundary.getOrDefault(XPath._NS_BOUNDARY, "0"));
         }
 
-        if (options.hasOption(_useXdkForXQuery)) {
-            //try XDK
-            query = (Query) _xdkQueryCache.get(queryExpr);
-            if (query != null) {
-                return query;
-            }
-
-            query = createXdkCompiledQuery(queryExpr, currentVar);
-            if (query != null) {
-                _xdkQueryCache.put(queryExpr, query);
-                return query;
-            }
-        }
 
-        if (!options.hasOption(_useDelegateForXQuery)) {
-            //try XQRL
-            query = (Query) _xqrlQueryCache.get(queryExpr);
-            if (query != null) {
-                return query;
-            }
-
-            query = createXqrlCompiledQuery(queryExpr, currentVar);
-            if (query != null) {
-                _xqrlQueryCache.put(queryExpr, query);
-                return query;
-            }
-        }
-
-        //otherwise (if _useDelegateForXQuery option is set),
-        //or if xqrl is not found, try delegate
-        //query = (Query) _delegateQueryCache.get(queryExpr);
-
-        //if (query != null)
-        //    return query;
-
-        String delIntfName =
-            options.hasOption(QUERY_DELEGATE_INTERFACE) ?
-                (String) options.get(QUERY_DELEGATE_INTERFACE) : _delIntfName;
+        String delIntfName = XBeansXQuery.class.getName();
         query = DelegateQueryImpl.createDelegateCompiledQuery(delIntfName, queryExpr, currentVar, boundaryVal, options);
 
         if (query != null) {
@@ -168,100 +92,8 @@ public abstract class Query {
         return queryExpr;
     }
 
-    private static Query createXdkCompiledQuery(String queryExpr, String currentVar) {
-        //if the XDK engine has been determined unavailable, return null
-        if (!_xdkAvailable) {
-            return null;
-        }
-        if (_xdkCompileQuery == null) {
-            try {
-                Class xdkImpl = Class.forName("org.apache.xmlbeans.impl.store.OXQXBXqrlImpl");
-
-                _xdkCompileQuery =
-                    xdkImpl.getDeclaredMethod("compileQuery",
-                        new Class[]{String.class, String.class, Boolean.class});
-            } catch (ClassNotFoundException e) {
-                _xdkAvailable = false;
-                return null;
-            } catch (Exception e) {
-                _xdkAvailable = false;
-                throw new RuntimeException(e.getMessage(), e);
-            }
-        }
-
-        Object[] args = new Object[]{queryExpr, currentVar, new Boolean(true)};
 
-        try {
-            return (Query) _xdkCompileQuery.invoke(null, args);
-        } catch (InvocationTargetException e) {
-            Throwable t = e.getCause();
-            throw new RuntimeException(t.getMessage(), t);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage(), e);
-        }
-    }
 
-    private static Query createXqrlCompiledQuery(String queryExpr, String currentVar) {
-        //if the XQRL engine has been determined unavailable, return null
-        if (!_xqrlAvailable) {
-            return null;
-        }
-        if (_xqrlCompileQuery == null) {
-            try {
-                Class xqrlImpl = Class.forName("org.apache.xmlbeans.impl.store.XqrlImpl");
-
-                _xqrlCompileQuery =
-                    xqrlImpl.getDeclaredMethod("compileQuery",
-                        new Class[]{String.class, String.class, Boolean.class});
-            } catch (ClassNotFoundException e) {
-                _xqrlAvailable = false;
-                return null;
-            } catch (Exception e) {
-                _xqrlAvailable = false;
-                throw new RuntimeException(e.getMessage(), e);
-            }
-        }
-
-        Object[] args = new Object[]{queryExpr, currentVar, new Boolean(true)};
-
-        try {
-            return (Query) _xqrlCompileQuery.invoke(null, args);
-        } catch (InvocationTargetException e) {
-            Throwable t = e.getCause();
-            throw new RuntimeException(t.getMessage(), t);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage(), e);
-        }
-    }
-
-    private static Query getXqrl2002CompiledQuery(String queryExpr, String currentVar) {
-        if (_xqrl2002Available && _xqrl2002CompileQuery == null) {
-            try {
-                Class xqrlImpl = Class.forName("org.apache.xmlbeans.impl.store.Xqrl2002Impl");
-
-                _xqrl2002CompileQuery =
-                    xqrlImpl.getDeclaredMethod("compileQuery",
-                        new Class[]{String.class, String.class, Boolean.class});
-            } catch (ClassNotFoundException e) {
-                _xqrl2002Available = false;
-                return null;
-            } catch (Exception e) {
-                _xqrl2002Available = false;
-                throw new RuntimeException(e.getMessage(), e);
-            }
-        }
-
-        Object[] args = new Object[]{queryExpr, currentVar, new Boolean(true)};
-
-        try {
-            return (Query) _xqrl2002CompileQuery.invoke(null, args);
-        } catch (InvocationTargetException e) {
-            Throwable t = e.getCause();
-            throw new RuntimeException(t.getMessage(), t);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException(e.getMessage(), e);
-        }
-    }
 
     private static final class DelegateQueryImpl extends Query {
         private DelegateQueryImpl(QueryDelegate.QueryInterface xqueryImpl) {

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saaj.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saaj.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saaj.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saaj.java Tue Sep  1 22:25:35 2020
@@ -44,10 +44,7 @@ import org.w3c.dom.Text;
 
 public interface Saaj
 {
-    // Use in XmlOptions to enable SAAJ support in store
-    
-    public static final String SAAJ_IMPL =  "SAAJ_IMPL";
-    
+
     public interface SaajCallback
     {
         void   setSaajData ( Node n, Object o );
@@ -61,7 +58,7 @@ public interface Saaj
     void setCallback ( SaajCallback callback );
 
     Class identifyElement ( QName name, QName parentName );
-    
+
     void        soapNode_detachNode       ( org.apache.xmlbeans.impl.soap.Node soapNode );
     void        soapNode_recycleNode      ( org.apache.xmlbeans.impl.soap.Node node );
     String      soapNode_getValue         ( org.apache.xmlbeans.impl.soap.Node node );
@@ -147,4 +144,4 @@ public interface Saaj
 
     DetailEntry detail_addDetailEntry   ( Detail detail, Name name );
     Iterator    detail_getDetailEntries ( Detail detail );
-} 
\ No newline at end of file
+}
\ No newline at end of file

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saver.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/store/Saver.java Tue Sep  1 22:25:35 2020
@@ -4006,11 +4006,11 @@ abstract class Saver {
 
             _prettyIndent = 2;
 
-            if (options.hasOption(XmlOptions.SAVE_PRETTY_PRINT_INDENT)) {
+            if (options.getSavePrettyPrintIndent() != null) {
                 _prettyIndent = options.getSavePrettyPrintIndent();
             }
 
-            if (options.hasOption(XmlOptions.SAVE_PRETTY_PRINT_OFFSET)) {
+            if (options.getSavePrettyPrintOffset() != null) {
                 _prettyOffset = options.getSavePrettyPrintOffset();
             }
 

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/InstanceValidator.java Tue Sep  1 22:25:35 2020
@@ -124,7 +124,7 @@ public class InstanceValidator {
             schemaOptions.setCompileNoUpaRule();
         }
         if (partial) {
-            schemaOptions.put("COMPILE_PARTIAL_TYPESYSTEM");
+            schemaOptions.setCompilePartialTypesystem();
         }
 
         if (jarFiles != null && jarFiles.length > 0) {

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/tool/TypeHierarchyPrinter.java Tue Sep  1 22:25:35 2020
@@ -143,7 +143,7 @@ public class TypeHierarchyPrinter
         if (noupa)
             schemaOptions.setCompileNoUpaRule();
         if (partial)
-            schemaOptions.put("COMPILE_PARTIAL_TYPESYSTEM");
+            schemaOptions.setCompilePartialTypesystem();
 
         if (jarFiles != null && jarFiles.length > 0)
             linkTo = XmlBeans.typeLoaderForResource(XmlBeans.resourceLoaderForPath(jarFiles));

Modified: xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java (original)
+++ xmlbeans/trunk/src/main/java/org/apache/xmlbeans/impl/validator/ValidatingXMLStreamReader.java Tue Sep  1 22:25:35 2020
@@ -52,8 +52,6 @@ public class ValidatingXMLStreamReader
     extends StreamReaderDelegate
     implements XMLStreamReader
 {
-    public static final String OPTION_ATTTRIBUTE_VALIDATION_COMPAT_MODE = "OPTION_ATTTRIBUTE_VALIDATION_COMPAT_MODE";
-
     private static final String URI_XSI = "http://www.w3.org/2001/XMLSchema-instance";
     private static final QName XSI_TYPE = new QName(URI_XSI, "type");
     private static final QName XSI_NIL  = new QName(URI_XSI, "nil");
@@ -802,7 +800,7 @@ public class ValidatingXMLStreamReader
             validate_attribute(i);
         }
 
-        if (_options!=null && _options.hasOption(OPTION_ATTTRIBUTE_VALIDATION_COMPAT_MODE))
+        if (_options!=null && _options.isAttributeValidationCompatMode())
         {}
         else
             _validator.nextEvent(Validator.ENDATTRS, _simpleEvent);

Modified: xmlbeans/trunk/src/test/java/compile/scomp/checkin/XmlBeansCompCheckinTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/compile/scomp/checkin/XmlBeansCompCheckinTests.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/compile/scomp/checkin/XmlBeansCompCheckinTests.java (original)
+++ xmlbeans/trunk/src/test/java/compile/scomp/checkin/XmlBeansCompCheckinTests.java Tue Sep  1 22:25:35 2020
@@ -113,7 +113,7 @@ public class XmlBeansCompCheckinTests ex
         TestFiler f = new TestFiler();
         ArrayList err = new ArrayList();
         XmlOptions opt = new XmlOptions().setErrorListener(err);
-        opt.put("COMPILE_PARTIAL_TYPESYSTEM");
+        opt.setCompilePartialTypesystem();
 
         try {
             // since you can't save a partial SOM, don't bother passing in a Filer

Modified: xmlbeans/trunk/src/test/java/compile/scomp/detailed/DetailedCompTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/compile/scomp/detailed/DetailedCompTests.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/compile/scomp/detailed/DetailedCompTests.java (original)
+++ xmlbeans/trunk/src/test/java/compile/scomp/detailed/DetailedCompTests.java Tue Sep  1 22:25:35 2020
@@ -157,7 +157,7 @@ public class DetailedCompTests {
         XmlOptions opts = new XmlOptions();
         ArrayList errors = new ArrayList();
         opts.setErrorListener(errors);
-        opts.put("COMPILE_PARTIAL_TYPESYSTEM");
+        opts.setCompilePartialTypesystem();
 
         // 1. Negative test - Error if xs:NOTATION used directly
         schema = schema_begin + root_decl + notation1 + root_end + schema_end;

Modified: xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java (original)
+++ xmlbeans/trunk/src/test/java/compile/scomp/detailed/XmlBeanCompilationTests.java Tue Sep  1 22:25:35 2020
@@ -160,7 +160,7 @@ public class XmlBeanCompilationTests ext
         SchemaTypeSystem sts;
         ArrayList err = new ArrayList();
         XmlOptions opt = new XmlOptions().setErrorListener(err);
-        opt.put("COMPILE_PARTIAL_TYPESYSTEM");
+        opt.setCompilePartialTypesystem();
 
         //BASIC COMPILATION
         sts = XmlBeans.compileXmlBeans(null,

Modified: xmlbeans/trunk/src/test/java/compile/scomp/som/checkin/PartialSOMCheckinTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/compile/scomp/som/checkin/PartialSOMCheckinTest.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/compile/scomp/som/checkin/PartialSOMCheckinTest.java (original)
+++ xmlbeans/trunk/src/test/java/compile/scomp/som/checkin/PartialSOMCheckinTest.java Tue Sep  1 22:25:35 2020
@@ -46,7 +46,7 @@ public class PartialSOMCheckinTest exten
         {
             options = (new XmlOptions()).setErrorListener(errors);
             options.setCompileDownloadUrls();
-            options.put("COMPILE_PARTIAL_TYPESYSTEM");
+            options.setCompilePartialTypesystem();
             options.setLoadLineNumbers();
         }
 

Modified: xmlbeans/trunk/src/test/java/compile/scomp/som/detailed/PartialSOMDetailedTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/compile/scomp/som/detailed/PartialSOMDetailedTest.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/compile/scomp/som/detailed/PartialSOMDetailedTest.java (original)
+++ xmlbeans/trunk/src/test/java/compile/scomp/som/detailed/PartialSOMDetailedTest.java Tue Sep  1 22:25:35 2020
@@ -45,7 +45,7 @@ public class PartialSOMDetailedTest exte
         if (options == null) {
             options = (new XmlOptions()).setErrorListener(errors);
             options.setCompileDownloadUrls();
-            options.put("COMPILE_PARTIAL_TYPESYSTEM");
+            options.setCompilePartialTypesystem();
             options.setLoadLineNumbers();
         }
 

Modified: xmlbeans/trunk/src/test/java/xmlcursor/xpath/xbean_xpath/detailed/AxesTest.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/test/java/xmlcursor/xpath/xbean_xpath/detailed/AxesTest.java?rev=1881383&r1=1881382&r2=1881383&view=diff
==============================================================================
--- xmlbeans/trunk/src/test/java/xmlcursor/xpath/xbean_xpath/detailed/AxesTest.java (original)
+++ xmlbeans/trunk/src/test/java/xmlcursor/xpath/xbean_xpath/detailed/AxesTest.java Tue Sep  1 22:25:35 2020
@@ -47,7 +47,7 @@ public class AxesTest {
 
     @Before
     public void setUp() {
-        options.put("use xbean for xpath");
+        options.setXPathUseXmlBeans();
     }
 
     @Test



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message