You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Mukul Gandhi <mu...@apache.org> on 2011/09/08 11:29:30 UTC

Re: svn commit: r1166522 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/ impl/msg/ impl/xs/ impl/xs/alternative/ impl/xs/traversers/ jaxp/validation/ parsers/

Hi all,
    I thought that it's good that I write about this issue to
xerces-dev list, since the code base changes that we did within Xerces
recently (the commit trace for these changes are in this mail trail)
affects a significant implementation design about use of XSD 1.1 CTA
feature, when we would use the XSD validator with Xerces.

There was a private discussion (and I'm writing here, some of design
decisions we agreed in that discussion) that went between some of
committers at Xerces, about devising a better design to select "XPath
subset" vs "full XPath language" while using XSD 1.1 CTA with Xerces.
We felt that there's value in supporting both of these XPath modes,
and the selection of this must be controlled by a Xerces feature (so
the user may explicitly decide, that which XPath mode should be active
during a validation episode, and no implicit fall back from "XPath
subset" to "full XPath" must occur [which occurred before this code
base change] -- we felt, that this was an ambiguous and isn't a good
design for XSD 1.1 CTA processing).

We also felt, that other than having an improved technical design as
mentioned above by providing this strict separation (via implementing
a Xerces feature) of XPath mode selection, we would also get following
benefits:

1. Supporting the subset can provide better performance, and can
improve inter-op with other XSD 1.1 implementations that only support
the subset.
2. Supporting full XPath helps us remain compatible with Saxon (which
is another well known XSD 1.1 implementation).

This particular code base change, implemented a Xerces feature
identified by the string Constants.XERCES_FEATURE_PREFIX +
Constants.CTA_FULL_XPATH_CHECKING_FEATURE (Class "Constants" belongs
to package, org.apache.xerces.impl), which by default is 'false'
(which means that XPath subset is active) and can be toggled to 'true'
(which activates full XPath for CTA, using the PsychoPath XPath 2.0
engine) by setting this feature on the JAXP SchemaFactory.

Please feel free to provide comments about these code base changes.

On Thu, Sep 8, 2011 at 9:16 AM,  <mu...@apache.org> wrote:
> Author: mukulg
> Date: Thu Sep  8 03:46:24 2011
> New Revision: 1166522
>
> URL: http://svn.apache.org/viewvc?rev=1166522&view=rev
> Log:
> schema 1.1 change: as per private discussion with Sandy Gao, implementing a feature to control "xpath subset" vs "full xpath" for CTA evaluation, with xpath subset being default.
>
> Modified:
>    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/msg/XMLSchemaMessages.properties
>    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java
>    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java
>    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
>    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java
>    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaValidatorComponentManager.java
>    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/StandardParserConfiguration.java
>    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/XML11Configuration.java
>
> 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=1166522&r1=1166521&r2=1166522&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 Thu Sep  8 03:46:24 2011
> @@ -334,6 +334,9 @@ 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 */
> +    public static final String CTA_FULL_XPATH_CHECKING_FEATURE = "validation/cta-full-xpath-checking";
> +
>     /** Feature to ignore errors caused by unparsed entities ("validation/unparsed-entity-checking") */
>     public static final String UNPARSED_ENTITY_CHECKING_FEATURE = "validation/unparsed-entity-checking";
>
> @@ -548,6 +551,7 @@ public final class Constants {
>             TOLERATE_DUPLICATES_FEATURE,
>             STRINGS_INTERNED_FEATURE,
>             TYPE_ALTERNATIVES_CHEKING_FEATURE,
> +            CTA_FULL_XPATH_CHECKING_FEATURE,
>     };
>
>     /** Xerces properties. */
>
> Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
> URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties?rev=1166522&r1=1166521&r2=1166522&view=diff
> ==============================================================================
> --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties (original)
> +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties Thu Sep  8 03:46:24 2011
> @@ -347,7 +347,7 @@
>         c-fields-xpaths = c-fields-xpaths: The field value = ''{0}'' is not valid.
>         c-general-xpath = c-general-xpath: The expression ''{0}'' is not valid with respect to the XPath subset supported by XML Schema.
>         c-general-xpath-ns = c-general-xpath-ns: A namespace prefix in XPath expression ''{0}'' was not bound to a namespace.
> -        c-cta-xpath = c-cta-xpath: The expression ''{0}'' is not a valid XPath expression, for CTA evaluation.
> +        c-cta-xpath = c-cta-xpath: The XPath expression ''{0}'' couldn''t compile successfully in ''{1}'' mode, during CTA evaluation.
>         c-selector-xpath = c-selector-xpath: The selector value = ''{0}'' is not valid; selector xpaths cannot contain attributes.
>         EmptyTargetNamespace = EmptyTargetNamespace: In schema document ''{0}'', the value of the ''targetNamespace'' attribute cannot be an empty string.
>         FacetValueFromBase = FacetValueFromBase: In the declaration of type ''{0}'', value ''{1}'' of facet ''{2}'' must be from the value space of the base type, ''{3}''.
>
> Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java
> URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java?rev=1166522&r1=1166521&r2=1166522&view=diff
> ==============================================================================
> --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java (original)
> +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/XMLSchemaLoader.java Thu Sep  8 03:46:24 2011
> @@ -146,6 +146,10 @@ XSLoader, DOMConfiguration {
>     protected static final String TOLERATE_DUPLICATES =
>         Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
>
> +    /** Feature identifier: tolerate duplicates */
> +    protected static final String CTA_FULL_XPATH =
> +        Constants.XERCES_FEATURE_PREFIX + Constants.CTA_FULL_XPATH_CHECKING_FEATURE;
> +
>     /** Property identifier: Schema DV Factory */
>     protected static final String SCHEMA_DV_FACTORY =
>         Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
> @@ -162,7 +166,8 @@ XSLoader, DOMConfiguration {
>         VALIDATE_ANNOTATIONS,
>         HONOUR_ALL_SCHEMALOCATIONS,
>         NAMESPACE_GROWTH,
> -        TOLERATE_DUPLICATES
> +        TOLERATE_DUPLICATES,
> +        CTA_FULL_XPATH,
>     };
>
>     // property identifiers
>
> Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java
> URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java?rev=1166522&r1=1166521&r2=1166522&view=diff
> ==============================================================================
> --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java (original)
> +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/alternative/Test.java Thu Sep  8 03:46:24 2011
> @@ -101,7 +101,7 @@ public class Test extends AbstractPsycho
>         if (fXPath != null) {
>             return fXPath.evaluateTest(element, attributes);
>         } else if (fXPathPsychoPath != null) {
> -            return evaluateTestExprWithPsychoPathEngine(element, attributes);
> +            return evaluateTestWithPsychoPathXPathEngine(element, attributes);
>         }
>         else {
>             return false;
> @@ -113,15 +113,15 @@ public class Test extends AbstractPsycho
>     }
>
>     /*
> -     * Evaluate the XPath "test" expression on an XDM instance, consisting of the specified element and its attributes.
> -     * Uses PsychoPath XPath 2.0 engine for the evaluation.
> +     * Evaluate the XPath "test" expression on an XDM instance, for CTA evaluation. Uses PsychoPath XPath 2.0 engine for the evaluation.
>      */
> -    private boolean evaluateTestExprWithPsychoPathEngine(QName element, XMLAttributes attributes) {
> +    private boolean evaluateTestWithPsychoPathXPathEngine(QName element, XMLAttributes attributes) {
>
>         boolean evaluationResult = false;
>
>         try {
> -            // an untyped PSVI DOM tree is constructed, to provide to PsychoPath engine for evaluation.
> +            // an untyped PSVI DOM tree (consisting only of the top most element node and it's attributes) is constructed,
> +            // to provide to PsychoPath XPath engine for evaluation.
>             Document document = new PSVIDocumentImpl();
>             Element elem = document.createElementNS(element.uri, element.rawname);
>             for (int attrIndx = 0; attrIndx < attributes.getLength(); attrIndx++) {
> @@ -146,6 +146,6 @@ public class Test extends AbstractPsycho
>
>         return evaluationResult;
>
> -    } // evaluateTestExprWithPsychoPathEngine
> +    } // evaluateTestWithPsychoPathXPathEngine
>
>  }
>
> Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java
> URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java?rev=1166522&r1=1166521&r2=1166522&view=diff
> ==============================================================================
> --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java (original)
> +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDHandler.java Thu Sep  8 03:46:24 2011
> @@ -77,7 +77,6 @@ import org.apache.xerces.util.StAXLocati
>  import org.apache.xerces.util.SymbolHash;
>  import org.apache.xerces.util.SymbolTable;
>  import org.apache.xerces.util.URI.MalformedURIException;
> -import org.apache.xerces.util.XMLChar;
>  import org.apache.xerces.util.XMLSymbols;
>  import org.apache.xerces.xni.QName;
>  import org.apache.xerces.xni.XNIException;
> @@ -179,6 +178,10 @@ public class XSDHandler {
>     protected static final String TOLERATE_DUPLICATES =
>       Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
>
> +    /** Feature identifier: Full XPath 2.0 for CTA evaluations */
> +    protected static final String CTA_FULL_XPATH =
> +      Constants.XERCES_FEATURE_PREFIX + Constants.CTA_FULL_XPATH_CHECKING_FEATURE;
> +
>     /** Feature identifier: namespace prefixes. */
>     private static final String NAMESPACE_PREFIXES =
>         Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACE_PREFIXES_FEATURE;
> @@ -403,6 +406,9 @@ public class XSDHandler {
>
>     // handle tolerate duplicates feature
>     boolean fTolerateDuplicates = false;
> +
> +    // handle full XPath 2.0 feature
> +    boolean fFullXPathForCTA = false;
>
>     // the XMLErrorReporter
>     private XMLErrorReporter fErrorReporter;
> @@ -3818,6 +3824,12 @@ public class XSDHandler {
>         } catch (XMLConfigurationException e) {
>             fTolerateDuplicates = false;
>         }
> +
> +        try {
> +            fFullXPathForCTA = componentManager.getFeature(CTA_FULL_XPATH);
> +        } catch (XMLConfigurationException e) {
> +            fFullXPathForCTA = false;
> +        }
>
>         try {
>             fSchemaParser.setFeature(
>
> Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java
> URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java?rev=1166522&r1=1166521&r2=1166522&view=diff
> ==============================================================================
> --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java (original)
> +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/xs/traversers/XSDTypeAlternativeTraverser.java Thu Sep  8 03:46:24 2011
> @@ -61,7 +61,9 @@ import org.w3c.dom.Element;
>  */
>  class XSDTypeAlternativeTraverser extends XSDAbstractTraverser {
>
> -    private static final XSSimpleType fErrorType;
> +    private static final XSSimpleType fErrorType;
> +    private boolean fIsFullXPathModeForCTA;
> +    private String[] fctaXPathModes = {"cta-subset", "cta-full"};
>
>     static {
>         SchemaGrammar grammar = SchemaGrammar.getS4SGrammar(Constants.SCHEMA_VERSION_1_1);
> @@ -70,6 +72,7 @@ class XSDTypeAlternativeTraverser extend
>
>     XSDTypeAlternativeTraverser (XSDHandler handler, XSAttributeChecker attrChecker) {
>         super(handler, attrChecker);
> +        fIsFullXPathModeForCTA = handler.fFullXPathForCTA;
>     }
>
>     /**
> @@ -188,21 +191,27 @@ class XSDTypeAlternativeTraverser extend
>         // now look for other optional attributes like test and xpathDefaultNamespace
>         if (testStr != null) {
>             Test testExpr = null;
> -            //set the test attribute value
>             try {
> -               testExpr = new Test(new XPath20(testStr, fSymbolTable, new NamespaceSupport(schemaDoc.fNamespaceSupport)), typeAlternative, new NamespaceSupport(schemaDoc.fNamespaceSupport));
> -            }
> +                if (fIsFullXPathModeForCTA) {
> +                    // if full XPath 2.0 support is enabled for CTA, use PsychoPath XPath 2.0 engine for XPath evaluation
> +                    XPathParser xpp = new JFlexCupParser();
> +                    XPath xp = xpp.parse("boolean(" + testStr + ")");
> +                    testExpr = new Test(xp, typeAlternative, schemaDoc.fNamespaceSupport);
> +                }
> +                else {
> +                    // if XPath subset is enabled for CTA (this is also the default option), use Xerces's native XPath parser for CTA
> +                    testExpr = new Test(new XPath20(testStr, fSymbolTable, new NamespaceSupport(schemaDoc.fNamespaceSupport)), typeAlternative, new NamespaceSupport(schemaDoc.fNamespaceSupport));
> +                }
> +            }
>             catch (XPathException e) {
> -               // fall back to full XPath 2.0 support, with PsychoPath engine
> -               try {
> -                  XPathParser xpp = new JFlexCupParser();
> -                  XPath xp = xpp.parse("boolean(" + testStr + ")");
> -                  testExpr = new Test(xp, typeAlternative, schemaDoc.fNamespaceSupport);
> -               } catch(XPathParserException ex) {
> -                  reportSchemaError("c-cta-xpath", new Object[] { testStr }, altElement);
> -                  //if the XPath is invalid, create a Test without an expression
> -                  testExpr = new Test((XPath20) null, typeAlternative, new NamespaceSupport(schemaDoc.fNamespaceSupport));
> -               }
> +                // if XPath expression couldn't compile, create a "test" without an expression
> +                testExpr = new Test((XPath20) null, typeAlternative, new NamespaceSupport(schemaDoc.fNamespaceSupport));
> +                reportSchemaError("c-cta-xpath", new Object[] {testStr, fctaXPathModes[0]}, altElement);
> +            }
> +            catch(XPathParserException ex) {
> +                // if XPath expression couldn't compile, create a "test" without an expression
> +                testExpr = new Test((XPath20) null, typeAlternative, new NamespaceSupport(schemaDoc.fNamespaceSupport));
> +                reportSchemaError("c-cta-xpath", new Object[] {testStr, fctaXPathModes[1]}, altElement);
>             }
>             typeAlternative.setTest(testExpr);
>         }
>
> Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaValidatorComponentManager.java
> URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaValidatorComponentManager.java?rev=1166522&r1=1166521&r2=1166522&view=diff
> ==============================================================================
> --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaValidatorComponentManager.java (original)
> +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/jaxp/validation/XMLSchemaValidatorComponentManager.java Thu Sep  8 03:46:24 2011
> @@ -87,6 +87,10 @@ final class XMLSchemaValidatorComponentM
>     private static final String TYPE_ALTERNATIVES_CHECKING =
>         Constants.XERCES_FEATURE_PREFIX + Constants.TYPE_ALTERNATIVES_CHEKING_FEATURE;
>
> +    /** Feature identifier: whether to use full XPath 2.0 support for CTA processing */
> +    private static final String CTA_FULL_XPATH_CHECKING =
> +        Constants.XERCES_FEATURE_PREFIX + Constants.CTA_FULL_XPATH_CHECKING_FEATURE;
> +
>     /** Feature identifier: disallow DOCTYPE declaration */
>     private static final String DISALLOW_DOCTYPE_DECL_FEATURE =
>         Constants.XERCES_FEATURE_PREFIX + Constants.DISALLOW_DOCTYPE_DECL_FEATURE;
> @@ -286,7 +290,8 @@ final class XMLSchemaValidatorComponentM
>         fFeatures.put(ID_IDREF_CHECKING, Boolean.TRUE);
>         fFeatures.put(IDENTITY_CONSTRAINT_CHECKING, Boolean.TRUE);
>         fFeatures.put(UNPARSED_ENTITY_CHECKING, Boolean.TRUE);
> -        fFeatures.put(TYPE_ALTERNATIVES_CHECKING, Boolean.TRUE);
> +        fFeatures.put(TYPE_ALTERNATIVES_CHECKING, Boolean.TRUE);
> +        fFeatures.put(CTA_FULL_XPATH_CHECKING, Boolean.FALSE);
>     }
>
>     /**
>
> Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/StandardParserConfiguration.java
> URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/StandardParserConfiguration.java?rev=1166522&r1=1166521&r2=1166522&view=diff
> ==============================================================================
> --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/StandardParserConfiguration.java (original)
> +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/StandardParserConfiguration.java Thu Sep  8 03:46:24 2011
> @@ -131,6 +131,10 @@ public class StandardParserConfiguration
>     /** Feature identifier: whether to ignore type alternatives errors */
>     protected static final String TYPE_ALTERNATIVES_CHECKING =
>         Constants.XERCES_FEATURE_PREFIX + Constants.TYPE_ALTERNATIVES_CHEKING_FEATURE;
> +
> +    /** Feature identifier: whether to use full XPath 2.0 support for CTA processing */
> +    protected static final String CTA_FULL_XPATH_CHECKING =
> +        Constants.XERCES_FEATURE_PREFIX + Constants.CTA_FULL_XPATH_CHECKING_FEATURE;
>
>     // property identifiers
>
> @@ -239,6 +243,7 @@ public class StandardParserConfiguration
>             IDENTITY_CONSTRAINT_CHECKING,
>             UNPARSED_ENTITY_CHECKING,
>             TYPE_ALTERNATIVES_CHECKING,
> +            CTA_FULL_XPATH_CHECKING,
>         };
>         addRecognizedFeatures(recognizedFeatures);
>
> @@ -257,6 +262,7 @@ public class StandardParserConfiguration
>         setFeature(IDENTITY_CONSTRAINT_CHECKING, true);
>         setFeature(UNPARSED_ENTITY_CHECKING, true);
>         setFeature(TYPE_ALTERNATIVES_CHECKING, true);
> +        setFeature(CTA_FULL_XPATH_CHECKING, false);
>
>         // add default recognized properties
>
>
> Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/XML11Configuration.java
> URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/XML11Configuration.java?rev=1166522&r1=1166521&r2=1166522&view=diff
> ==============================================================================
> --- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/XML11Configuration.java (original)
> +++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/parsers/XML11Configuration.java Thu Sep  8 03:46:24 2011
> @@ -196,6 +196,10 @@ public class XML11Configuration extends
>     protected static final String TYPE_ALTERNATIVES_CHECKING =
>         Constants.XERCES_FEATURE_PREFIX + Constants.TYPE_ALTERNATIVES_CHEKING_FEATURE;
>
> +    /** Feature identifier: whether to use full XPath 2.0 support for CTA processing */
> +    protected static final String CTA_FULL_XPATH_CHECKING =
> +        Constants.XERCES_FEATURE_PREFIX + Constants.CTA_FULL_XPATH_CHECKING_FEATURE;
> +
>
>     // property identifiers
>
> @@ -499,6 +503,7 @@ public class XML11Configuration extends
>                        ID_IDREF_CHECKING, IDENTITY_CONSTRAINT_CHECKING,
>                        UNPARSED_ENTITY_CHECKING, USE_GRAMMAR_POOL_ONLY,
>                        TYPE_ALTERNATIVES_CHECKING,
> +                       CTA_FULL_XPATH_CHECKING,
>                        // NOTE: These shouldn't really be here but since the XML Schema
>                        //       validator is constructed dynamically, its recognized
>                        //       features might not have been set and it would cause a
>
>




-- 
Regards,
Mukul Gandhi

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


Re: svn commit: r1166522 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/ impl/msg/ impl/xs/ impl/xs/alternative/ impl/xs/traversers/ jaxp/validation/ parsers/

Posted by Mukul Gandhi <mu...@apache.org>.
Hi Michael,
   Thanks for looking through this topic.

I appreciate your insights on technical activities that we do here
with Xerces :) Your suggestions are very helpful for the Xerces & XML
community.

I fully agree with you, that all design discussions about Xerces-J
must happen on this list. But incidentally I couldn't really avoid
this particular situation of having discussion about this topic
off-line. I assure you and the community, that in future I would make
all discussions about Xerces on the project mailing list.


On Thu, Sep 8, 2011 at 6:21 PM, Michael Glavassevich
<mr...@ca.ibm.com> wrote:
> Hi Mukul,
>
> Thanks for the summary, though I'm sure you're well aware that decisions
> need to be made through discussion here on the mailing list. If you find
> yourself in an off-list discussion, bring it back to the list first and
> summarize your thoughts so that the community has an opportunity to weigh
> in.
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org




-- 
Regards,
Mukul Gandhi

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


Re: svn commit: r1166522 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/ impl/msg/ impl/xs/ impl/xs/alternative/ impl/xs/traversers/ jaxp/validation/ parsers/

Posted by Mukul Gandhi <mu...@apache.org>.
Hi Michael,
    Thanks for the reference to this older discussion. Reading this is helpful.

On Thu, Sep 8, 2011 at 7:30 PM, Michael Glavassevich
<mr...@ca.ibm.com> wrote:
> Also note that we did have a discussion on this topic back in November 2010
> [1] which touched on some of the points you've mentioned here.
>
> [1] http://markmail.org/message/yyqtyr7pttfvjhom
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org




-- 
Regards,
Mukul Gandhi

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


Re: svn commit: r1166522 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/ impl/msg/ impl/xs/ impl/xs/alternative/ impl/xs/traversers/ jaxp/validation/ parsers/

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Also note that we did have a discussion on this topic back in November 2010
[1] which touched on some of the points you've mentioned here.

[1] http://markmail.org/message/yyqtyr7pttfvjhom

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Michael Glavassevich <mr...@ca.ibm.com> wrote on 09/08/2011 08:51:55 AM:

> Hi Mukul,
>
> Thanks for the summary, though I'm sure you're well aware that
> decisions need to be made through discussion here on the mailing
> list. If you find yourself in an off-list discussion, bring it back
> to the list first and summarize your thoughts so that the community
> has an opportunity to weigh in.
>
> Thanks.
>
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
>
> Mukul Gandhi <mu...@apache.org> wrote on 09/08/2011 05:29:30 AM:
>
> > Hi all,
> >     I thought that it's good that I write about this issue to
> > xerces-dev list, since the code base changes that we did within Xerces
> > recently (the commit trace for these changes are in this mail trail)
> > affects a significant implementation design about use of XSD 1.1 CTA
> > feature, when we would use the XSD validator with Xerces.
> >
> > There was a private discussion (and I'm writing here, some of design
> > decisions we agreed in that discussion) that went between some of
> > committers at Xerces, about devising a better design to select "XPath
> > subset" vs "full XPath language" while using XSD 1.1 CTA with Xerces.
> > We felt that there's value in supporting both of these XPath modes,
> > and the selection of this must be controlled by a Xerces feature (so
> > the user may explicitly decide, that which XPath mode should be active
> > during a validation episode, and no implicit fall back from "XPath
> > subset" to "full XPath" must occur [which occurred before this code
> > base change] -- we felt, that this was an ambiguous and isn't a good
> > design for XSD 1.1 CTA processing).
> >
> > We also felt, that other than having an improved technical design as
> > mentioned above by providing this strict separation (via implementing
> > a Xerces feature) of XPath mode selection, we would also get following
> > benefits:
> >
> > 1. Supporting the subset can provide better performance, and can
> > improve inter-op with other XSD 1.1 implementations that only support
> > the subset.
> > 2. Supporting full XPath helps us remain compatible with Saxon (which
> > is another well known XSD 1.1 implementation).
> >
> > This particular code base change, implemented a Xerces feature
> > identified by the string Constants.XERCES_FEATURE_PREFIX +
> > Constants.CTA_FULL_XPATH_CHECKING_FEATURE (Class "Constants" belongs
> > to package, org.apache.xerces.impl), which by default is 'false'
> > (which means that XPath subset is active) and can be toggled to 'true'
> > (which activates full XPath for CTA, using the PsychoPath XPath 2.0
> > engine) by setting this feature on the JAXP SchemaFactory.
> >
> > Please feel free to provide comments about these code base changes.

Re: svn commit: r1166522 - in /xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces: impl/ impl/msg/ impl/xs/ impl/xs/alternative/ impl/xs/traversers/ jaxp/validation/ parsers/

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Mukul,

Thanks for the summary, though I'm sure you're well aware that decisions
need to be made through discussion here on the mailing list. If you find
yourself in an off-list discussion, bring it back to the list first and
summarize your thoughts so that the community has an opportunity to weigh
in.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Mukul Gandhi <mu...@apache.org> wrote on 09/08/2011 05:29:30 AM:

> Hi all,
>     I thought that it's good that I write about this issue to
> xerces-dev list, since the code base changes that we did within Xerces
> recently (the commit trace for these changes are in this mail trail)
> affects a significant implementation design about use of XSD 1.1 CTA
> feature, when we would use the XSD validator with Xerces.
>
> There was a private discussion (and I'm writing here, some of design
> decisions we agreed in that discussion) that went between some of
> committers at Xerces, about devising a better design to select "XPath
> subset" vs "full XPath language" while using XSD 1.1 CTA with Xerces.
> We felt that there's value in supporting both of these XPath modes,
> and the selection of this must be controlled by a Xerces feature (so
> the user may explicitly decide, that which XPath mode should be active
> during a validation episode, and no implicit fall back from "XPath
> subset" to "full XPath" must occur [which occurred before this code
> base change] -- we felt, that this was an ambiguous and isn't a good
> design for XSD 1.1 CTA processing).
>
> We also felt, that other than having an improved technical design as
> mentioned above by providing this strict separation (via implementing
> a Xerces feature) of XPath mode selection, we would also get following
> benefits:
>
> 1. Supporting the subset can provide better performance, and can
> improve inter-op with other XSD 1.1 implementations that only support
> the subset.
> 2. Supporting full XPath helps us remain compatible with Saxon (which
> is another well known XSD 1.1 implementation).
>
> This particular code base change, implemented a Xerces feature
> identified by the string Constants.XERCES_FEATURE_PREFIX +
> Constants.CTA_FULL_XPATH_CHECKING_FEATURE (Class "Constants" belongs
> to package, org.apache.xerces.impl), which by default is 'false'
> (which means that XPath subset is active) and can be toggled to 'true'
> (which activates full XPath for CTA, using the PsychoPath XPath 2.0
> engine) by setting this feature on the JAXP SchemaFactory.
>
> Please feel free to provide comments about these code base changes.