sandygao    2003/02/10 06:40:59

  Modified:    java/src/org/apache/xerces/impl/xs
                        SubstitutionGroupHandler.java
  Log:
  1. Should combine the derivation methods (missed bit-or operation);
  2. Need to deal with the special case of the base type of anySimpleType.
  
  Revision  Changes    Path
  1.11      +7 -3      
xml-xerces/java/src/org/apache/xerces/impl/xs/SubstitutionGroupHandler.java
  
  Index: SubstitutionGroupHandler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/SubstitutionGroupHandler.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SubstitutionGroupHandler.java     7 Feb 2003 15:32:48 -0000       1.10
  +++ SubstitutionGroupHandler.java     10 Feb 2003 14:40:59 -0000      1.11
  @@ -144,10 +144,14 @@
           XSTypeDefinition type = element.fType;
           while (type != exemplar.fType && type != SchemaGrammar.fAnyType) {
               if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
  -                devMethod = ((XSComplexTypeDecl)type).fDerivedBy;
  +                devMethod |= ((XSComplexTypeDecl)type).fDerivedBy;
               else
  -                devMethod = XSConstants.DERIVATION_RESTRICTION;
  +                devMethod |= XSConstants.DERIVATION_RESTRICTION;
               type = type.getBaseType();
  +            // type == null means the current type is anySimpleType,
  +            // whose base type should be anyType
  +            if (type == null)
  +                type = SchemaGrammar.fAnyType;
               if (type.getTypeCategory() == XSTypeDefinition.COMPLEX_TYPE)
                   blockConstraint |= ((XSComplexTypeDecl)type).fBlock;
           }
  
  
  

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

Reply via email to