You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by lm...@apache.org on 2001/05/17 15:34:33 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/framework XMLParser.java

lmartin     01/05/17 06:34:30

  Modified:    java/src/org/apache/xerces/framework XMLParser.java
  Log:
  added a new feature to ensure full schema constraint checking
  
  Revision  Changes    Path
  1.30      +46 -1     xml-xerces/java/src/org/apache/xerces/framework/XMLParser.java
  
  Index: XMLParser.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/framework/XMLParser.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- XMLParser.java	2001/05/10 21:25:05	1.29
  +++ XMLParser.java	2001/05/17 13:34:24	1.30
  @@ -90,7 +90,7 @@
   /**
    * This is the base class of all standard parsers.
    *
  - * @version $Id: XMLParser.java,v 1.29 2001/05/10 21:25:05 elena Exp $
  + * @version $Id: XMLParser.java,v 1.30 2001/05/17 13:34:24 lmartin Exp $
    */
   public abstract class XMLParser 
       implements XMLErrorReporter, XMLDocumentHandler.DTDHandler {
  @@ -124,6 +124,7 @@
           "http://xml.org/sax/features/namespaces",
           // Xerces
           "http://apache.org/xml/features/validation/schema",
  +        "http://apache.org/xml/features/validation/schema-full-checking",
           "http://apache.org/xml/features/validation/dynamic",
           "http://apache.org/xml/features/validation/default-attribute-values",
           "http://apache.org/xml/features/validation/validate-content-models",
  @@ -605,6 +606,41 @@
       }
   
       /**
  +     * Allows the user to turn full Schema constraint checking on/off.  
  +     * Only takes effect if Schema validation is enabled.                  
  +     * If this feature is off, partial constraint checking is done.
  +     * <p>
  +     * This method is equivalent to the feature:
  +     * <pre>
  +     * http://apache.org/xml/features/validation/schema-full-checking
  +     * </pre>
  +     *
  +     * @param schemaFullChecking True to turn on full schema constraint checking.
  +     *
  +     * @see #getValidationSchemaFullChecking
  +     * @see #setFeature
  +     */
  +    protected void setValidationSchemaFullChecking(boolean schemaFullChecking) 
  +        throws SAXNotRecognizedException, SAXNotSupportedException {
  +        if (fParseInProgress) {
  +            // REVISIT: Localize message
  +            throw new SAXNotSupportedException("http://apache.org/xml/features/validation/schema-full-checking:  parse is in progress");
  +        }
  +        fValidator.setSchemaFullCheckingEnabled(schemaFullChecking);
  +    }
  +
  +    /**
  +     * Returns true if Schema support is turned on.
  +     *
  +     * @see #setValidationSchemaFullChecking
  +     */
  +    protected boolean getValidationSchemaFullChecking()
  +        throws SAXNotRecognizedException, SAXNotSupportedException {
  +        return fValidator.getSchemaFullCheckingEnabled();
  +    }
  +
  +
  +    /**
        * Allows the parser to validate a document only when it contains a
        * grammar. Validation is turned on/off based on each document
        * instance, automatically.
  @@ -1235,6 +1271,15 @@
                   setValidationSchema(state);
                   return;
               }
  +            //
  +            // http://apache.org/xml/features/validation/schema-full-checking
  +            //   Lets the user turn Schema full constraint checking on/off.
  +            //
  +            if (feature.equals("validation/schema-full-checking")) {
  +                setValidationSchemaFullChecking(state);
  +                return;
  +            }
  +
               //
               // http://apache.org/xml/features/validation/dynamic
               //   Allows the parser to validate a document only when it
  
  
  

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