You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mu...@apache.org on 2019/07/15 11:47:25 UTC

svn commit: r1863082 - in /xerces/java/branches/xml-schema-1.1-dev: samples/jaxp/SourceValidator.java src/org/apache/xerces/impl/Constants.java src/org/apache/xerces/impl/xs/XMLSchemaValidatorBase.java

Author: mukulg
Date: Mon Jul 15 11:47:25 2019
New Revision: 1863082

URL: http://svn.apache.org/viewvc?rev=1863082&view=rev
Log:
committing fix for jira issue XERCESJ-1699

Modified:
    xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidatorBase.java

Modified: xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java?rev=1863082&r1=1863081&r2=1863082&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/samples/jaxp/SourceValidator.java Mon Jul 15 11:47:25 2019
@@ -87,7 +87,7 @@ public class SourceValidator implements
     /** Generate synthetic schema annotations feature id (http://apache.org/xml/features/generate-synthetic-annotations). */
     protected static final String GENERATE_SYNTHETIC_ANNOTATIONS_ID = "http://apache.org/xml/features/generate-synthetic-annotations";
     
-    /** XSD 1.1 CTA full XPath checking feature id (http://apache.org/xml/features/validation/cta-full-xpath-checking). */
+    /** XSD 1.1 CTA full XPath 2.0 checking feature id (http://apache.org/xml/features/validation/cta-full-xpath-checking). */
     protected static final String XS11_CTA_FULL_XPATH_CHECKING_ID = "http://apache.org/xml/features/validation/cta-full-xpath-checking";
     
     /** XSD 1.1 assert comments and PI checking feature id (http://apache.org/xml/features/validation/assert-comments-and-pi-checking). */
@@ -546,6 +546,18 @@ public class SourceValidator implements
             }
             
             if (XSD11_SCHEMA_LANGUAGE.equals(schemaLanguage)) {
+                try {
+                    validator.setFeature(XS11_CTA_FULL_XPATH_CHECKING_ID, xs11CtaFullxpathchecking);
+                }
+                catch (SAXNotRecognizedException e) {
+                    System.err.println("warning: Validator does not recognize feature ("+XS11_CTA_FULL_XPATH_CHECKING_ID+")");
+                }
+                catch (SAXNotSupportedException e) {
+                    System.err.println("warning: Validator does not support feature ("+XS11_CTA_FULL_XPATH_CHECKING_ID+")");
+                }
+            }
+            
+            if (XSD11_SCHEMA_LANGUAGE.equals(schemaLanguage)) {
                 try {
                     validator.setFeature(XS11_ASSERT_COMMENT_PI_CHECKING_ID, xs11AssertCommentsAndPIchecking);
                 }

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java?rev=1863082&r1=1863081&r2=1863082&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/Constants.java Mon Jul 15 11:47:25 2019
@@ -334,10 +334,10 @@ public final class Constants {
     /** Feature to ignore errors caused by type alternatives */
     public static final String TYPE_ALTERNATIVES_CHEKING_FEATURE = "validation/type-alternative-checking";
     
-    /** Feature to control full XPath 2.0 checking for CTA processing */
+    /** Feature to allow full XPath 2.0 checking for CTA processing */
     public static final String CTA_FULL_XPATH_CHECKING_FEATURE = "validation/cta-full-xpath-checking";
     
-    /** Feature to control, if comments and PIs should be available in <assert> XDM trees */
+    /** Feature to allow if comments and PIs should be available in <assert> XDM trees */
     public static final String ASSERT_COMMENT_PI_CHECKING_FEATURE = "validation/assert-comments-and-pi-checking";
     
     /** Feature to ignore errors caused by unparsed entities ("validation/unparsed-entity-checking") */

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidatorBase.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidatorBase.java?rev=1863082&r1=1863081&r2=1863082&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidatorBase.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaValidatorBase.java Mon Jul 15 11:47:25 2019
@@ -185,6 +185,10 @@ public class XMLSchemaValidatorBase impl
     protected static final String TYPE_ALTERNATIVES_CHECKING =
         Constants.XERCES_FEATURE_PREFIX + Constants.TYPE_ALTERNATIVES_CHEKING_FEATURE;
     
+    /** Feature identifier: whether to allow full XPath 2.0 checking for CTA processing */
+    protected static final String CTA_FULL_XPATH_CHECKING =
+        Constants.XERCES_FEATURE_PREFIX + Constants.CTA_FULL_XPATH_CHECKING_FEATURE;
+    
     /** Feature identifier: whether to allow comment and PI nodes to be visible during <assert> processing */
     protected static final String ASSERT_COMMENT_PI_CHECKING =
         Constants.XERCES_FEATURE_PREFIX + Constants.ASSERT_COMMENT_PI_CHECKING_FEATURE;
@@ -272,6 +276,7 @@ public class XMLSchemaValidatorBase impl
             NAMESPACE_GROWTH,
             TOLERATE_DUPLICATES,
             TYPE_ALTERNATIVES_CHECKING,
+            CTA_FULL_XPATH_CHECKING,
             ASSERT_COMMENT_PI_CHECKING
         };
 



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