sandygao    2003/01/21 09:51:05

  Modified:    java/src/org/apache/xerces/impl/msg
                        XMLSchemaMessages.properties
               java/src/org/apache/xerces/impl/xs/traversers
                        XSDComplexTypeTraverser.java
  Log:
  More changes for E1-5: error code; an NPE introduced from a previous commit.
  
  Revision  Changes    Path
  1.60      +2 -2      
xml-xerces/java/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties
  
  Index: XMLSchemaMessages.properties
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/msg/XMLSchemaMessages.properties,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- XMLSchemaMessages.properties      20 Jan 2003 19:45:25 -0000      1.59
  +++ XMLSchemaMessages.properties      21 Jan 2003 17:51:04 -0000      1.60
  @@ -186,7 +186,7 @@
           cos-ct-derived-ok = cos-ct-derived-ok: error.
           cos-ct-extends = cos-ct-extends: error.
           cos-ct-extends.1.1 = cos-ct-extends.1.1: Error for type ''{0}''.  Extension 
must not be in the final set of the base type.
  -        cos-ct-extends.1.4.2.2.2.2.1 = cos-ct-extends.1.4.2.2.2.2.1: Error for type 
''{0}''.  The content type of a derived type and that of its base must both be mixed 
or element-only.
  +        cos-ct-extends.1.4.3.2.2.1 = cos-ct-extends.1.4.3.2.2.1: Error for type 
''{0}''.  The content type of a derived type and that of its base must both be mixed 
or element-only.
           cos-element-consistent = cos-element-consistent: Error for type ''{0}''.  
Multiple elements with name ''{1}'', with different types, appear in the model group.
           cos-equiv-class = cos-equiv-class: error.
           cos-equiv-derived-ok-rec = cos-equiv-derived-ok-rec: error.
  
  
  
  1.30      +12 -18    
xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java
  
  Index: XSDComplexTypeTraverser.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDComplexTypeTraverser.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- XSDComplexTypeTraverser.java      20 Jan 2003 16:59:22 -0000      1.29
  +++ XSDComplexTypeTraverser.java      21 Jan 2003 17:51:05 -0000      1.30
  @@ -731,6 +731,17 @@
               else if (baseType.getContentType() == 
XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
               }
               else {
  +                //
  +                // Check if the contentType of the base is consistent with the new 
type
  +                // cos-ct-extends.1.4.3.2
  +                if (fContentType == XSComplexTypeDecl.CONTENTTYPE_ELEMENT &&
  +                    baseType.getContentType() != 
XSComplexTypeDecl.CONTENTTYPE_ELEMENT ||
  +                    fContentType == XSComplexTypeDecl.CONTENTTYPE_MIXED &&
  +                    baseType.getContentType() != 
XSComplexTypeDecl.CONTENTTYPE_MIXED) {
  +                    throw new 
ComplexTypeRecoverableError("cos-ct-extends.1.4.3.2.2.1",
  +                            new Object[]{fName}, complexContent);
  +                }
  +
                   // if the content of either type is an "all" model group, error.
                   if (fParticle.fType == XSParticleDecl.PARTICLE_MODELGROUP &&
                       ((XSModelGroupImpl)fParticle.fValue).fCompositor == 
XSModelGroupImpl.MODELGROUP_ALL ||
  @@ -752,23 +763,6 @@
                   particle.fValue = group;
                   
                   fParticle = particle;
  -            }
  -
  -            //
  -            // Check if the contentType of the base is consistent with the new type
  -            // cos-ct-extends.1.4.2.2
  -            if (baseType.getContentType() != XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
  -                if (((baseType.getContentType() ==
  -                      XSComplexTypeDecl.CONTENTTYPE_ELEMENT) &&
  -                     fContentType != XSComplexTypeDecl.CONTENTTYPE_ELEMENT) ||
  -                    ((baseType.getContentType() ==
  -                      XSComplexTypeDecl.CONTENTTYPE_MIXED) &&
  -                      fContentType != XSComplexTypeDecl.CONTENTTYPE_MIXED)) {
  -
  -                    throw new 
ComplexTypeRecoverableError("cos-ct-extends.1.4.2.2.2.2.1",
  -                          new Object[]{fName}, complexContent);
  -                }
  -
               }
   
               // Remove prohibited uses.   Must be done before merge for EXTENSION.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to