You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by sa...@apache.org on 2001/06/11 23:45:03 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/validators/schema TraverseSchema.java SchemaGrammar.java

sandygao    01/06/11 14:45:03

  Modified:    java/src/org/apache/xerces/validators/schema
                        TraverseSchema.java SchemaGrammar.java
  Log:
  no message
  
  Revision  Changes    Path
  1.194     +20 -20    xml-xerces/java/src/org/apache/xerces/validators/schema/TraverseSchema.java
  
  Index: TraverseSchema.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/schema/TraverseSchema.java,v
  retrieving revision 1.193
  retrieving revision 1.194
  diff -u -r1.193 -r1.194
  --- TraverseSchema.java	2001/06/11 16:05:23	1.193
  +++ TraverseSchema.java	2001/06/11 21:44:53	1.194
  @@ -128,7 +128,7 @@
    *
    * @see org.apache.xerces.validators.common.Grammar
    *
  - * @version $Id: TraverseSchema.java,v 1.193 2001/06/11 16:05:23 neilg Exp $
  + * @version $Id: TraverseSchema.java,v 1.194 2001/06/11 21:44:53 sandygao Exp $
    */
   public class TraverseSchema implements
                               NamespacesScope.NamespacesHandler{
  @@ -501,13 +501,15 @@
                              GrammarResolver grammarResolver,
                              XMLErrorReporter errorReporter,
                              String schemaURL,
  -                   EntityResolver entityResolver,
  -                           boolean fullChecking
  +                           EntityResolver entityResolver,
  +                           boolean fullChecking,
  +                           GeneralAttrCheck generalAttrCheck
                              ) throws Exception {
           fErrorReporter = errorReporter;
           fCurrentSchemaURL = schemaURL;
           fFullConstraintChecking = fullChecking;
  -    fEntityResolver = entityResolver;
  +        fEntityResolver = entityResolver;
  +        fGeneralAttrCheck = generalAttrCheck;
           doTraverseSchema(root, stringPool, schemaGrammar, grammarResolver);
       }
   
  @@ -516,20 +518,24 @@
                              GrammarResolver grammarResolver,
                              XMLErrorReporter errorReporter,
                              String schemaURL,
  -                           boolean fullChecking
  +                           boolean fullChecking,
  +                           GeneralAttrCheck generalAttrCheck
                              ) throws Exception {
           fErrorReporter = errorReporter;
           fCurrentSchemaURL = schemaURL;
           fFullConstraintChecking = fullChecking;
  +        fGeneralAttrCheck = generalAttrCheck;
           doTraverseSchema(root, stringPool, schemaGrammar, grammarResolver);
       }
   
       public  TraverseSchema(Element root, StringPool stringPool,
                              SchemaGrammar schemaGrammar,
                              GrammarResolver grammarResolver,
  -                           boolean fullChecking
  +                           boolean fullChecking,
  +                           GeneralAttrCheck generalAttrCheck
                              ) throws Exception {
           fFullConstraintChecking = fullChecking;
  +        fGeneralAttrCheck = generalAttrCheck;
           doTraverseSchema(root, stringPool, schemaGrammar, grammarResolver);
       }
   
  @@ -553,8 +559,6 @@
           //Expand to registry type to contain all primitive datatype
           fDatatypeRegistry.expandRegistryToFullSchemaSet();
   
  -        // General Attribute Checking
  -        fGeneralAttrCheck = new GeneralAttrCheck(fErrorReporter);
           fXsiURI = fStringPool.addSymbol(SchemaSymbols.URI_XSI);
   
           if (root == null) {
  @@ -749,10 +753,6 @@
                   traverseIdentityRefConstraintsFor(elementIndex, identityConstraints);
               }
           }
  -
  -        // General Attribute Checking
  -        fGeneralAttrCheck = null;
  -
       } // traverseSchema(Element)
   
   
  @@ -1201,7 +1201,7 @@
                   // we have yet to be renamed.
                   try {
                       Integer i = (Integer)fGroupNameRegistry.get(fTargetNSURIString + ","+dName);
  -                    // if that succeeded then we're done; were ref'd here in 
  +                    // if that succeeded then we're done; were ref'd here in
                       // an include most likely.
                       continue;
                   } catch (ClassCastException c) {
  @@ -1936,7 +1936,7 @@
                                             +targetNSURI+"' from what is declared '"+namespaceString+"'.");
                }
                else {
  -                 TraverseSchema impSchema = new TraverseSchema(root, fStringPool, importedGrammar, fGrammarResolver, fErrorReporter, location, fEntityResolver, fFullConstraintChecking);
  +                 TraverseSchema impSchema = new TraverseSchema(root, fStringPool, importedGrammar, fGrammarResolver, fErrorReporter, location, fEntityResolver, fFullConstraintChecking, fGeneralAttrCheck);
                    Enumeration ics = impSchema.fIdentityConstraints.keys();
                    while(ics.hasMoreElements()) {
                       Object icsKey = ics.nextElement();
  @@ -3277,7 +3277,7 @@
                                  " derivedBy=" + typeInfo.derivedBy +
                                " contentType=" + typeInfo.contentType +
                                  " contentSpecHandle=" + typeInfo.contentSpecHandle +
  -                               " datatypeValidator=" + typeInfo.datatypeValidator + 
  +                               " datatypeValidator=" + typeInfo.datatypeValidator +
                                  " scopeDefined=" + typeInfo.scopeDefined);
   
           fComplexTypeRegistry.put(typeName,typeInfo);
  @@ -4467,14 +4467,14 @@
                    }
                    else {
                      // update the element decl with info from the type
  -                
  +
                      fSchemaGrammar.getElementDecl(elementIndex, fTempElementDecl);
                      fTempElementDecl.type = typeInfo.contentType;
                      fTempElementDecl.contentSpecIndex = typeInfo.contentSpecHandle;
  -                   fTempElementDecl.datatypeValidator = typeInfo.datatypeValidator; 
  +                   fTempElementDecl.datatypeValidator = typeInfo.datatypeValidator;
                      fSchemaGrammar.setElementDecl(elementIndex, fTempElementDecl);
   
  -                   fSchemaGrammar.setFirstAttributeDeclIndex(elementIndex, 
  +                   fSchemaGrammar.setFirstAttributeDeclIndex(elementIndex,
                           typeInfo.attlistHead);
                      fSchemaGrammar.setElementComplexTypeInfo(elementIndex,typeInfo);
   
  @@ -6507,7 +6507,7 @@
                           int eltIndex = fSchemaGrammar.addElementDecl(tempQName,
                                 fCurrentScope, fCurrentScope, -1, -1, -1, null);
                           fElementRecurseComplex.addElement(new ElementInfo(eltIndex,anonTypeName));
  -                        return tempQName; 
  +                        return tempQName;
   
                       }
                       else {
  @@ -7001,7 +7001,7 @@
               // REVISIT: localize
               reportGenericSchemaError("The content of an identity constraint must match (annotation?, selector, field+)");
               return;
  -        } 
  +        }
           sElem = checkContent( icElem, sElem, false);
           // General Attribute Checking
           attrValues = fGeneralAttrCheck.checkAttributes(sElem, scope);
  
  
  
  1.31      +7 -7      xml-xerces/java/src/org/apache/xerces/validators/schema/SchemaGrammar.java
  
  Index: SchemaGrammar.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/validators/schema/SchemaGrammar.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- SchemaGrammar.java	2001/06/08 17:51:53	1.30
  +++ SchemaGrammar.java	2001/06/11 21:44:56	1.31
  @@ -60,7 +60,7 @@
    * @author Eric Ye
    *
    * @see
  - * @version $Id: SchemaGrammar.java,v 1.30 2001/06/08 17:51:53 lmartin Exp $
  + * @version $Id: SchemaGrammar.java,v 1.31 2001/06/11 21:44:56 sandygao Exp $
    */
   package org.apache.xerces.validators.schema;
   
  @@ -347,26 +347,26 @@
   
       // Unique Particle Attribution
       // overrides same method from Grammar, to do UPA checking
  -    public XMLContentModel getElementContentModel(int elementDeclIndex, SubstitutionGroupComparator comparator) throws CMException {
  +    public XMLContentModel getContentModel(int contentSpecIndex, int contentType, SubstitutionGroupComparator comparator) throws CMException {
           // if the content model is already there, no UPA checking is necessary
  -        if (existElementContentModel(elementDeclIndex))
  -            return super.getElementContentModel(elementDeclIndex, comparator);
  +        if (existContentModel(contentSpecIndex))
  +            return super.getContentModel(contentSpecIndex, contentType, comparator);
   
           // if it's not there, we create a new one, do UPA checking,
           // then throw it away. because UPA checking might result in NFA,
           // but we need DFA for further checking
           if (checkUniqueParticleAttribution) {
               checkingUPA = true;
  -            XMLContentModel contentModel = super.getElementContentModel(elementDeclIndex, comparator);
  +            XMLContentModel contentModel = super.getContentModel(contentSpecIndex, contentType, comparator);
               checkingUPA = false;
   
               if (contentModel != null) {
                   contentModel.checkUniqueParticleAttribution(this);
  -                clearElementContentModel(elementDeclIndex);
  +                clearContentModel(contentSpecIndex);
               }
           }
   
  -        return super.getElementContentModel(elementDeclIndex, comparator);
  +        return super.getContentModel(contentSpecIndex, contentType, comparator);
       }
   
       // Unique Particle Attribution
  
  
  

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