peiyongz    2003/11/12 12:35:32

  Modified:    c/src/xercesc/validators/schema GeneralAttributeCheck.cpp
                        GeneralAttributeCheck.hpp SchemaGrammar.cpp
                        SchemaGrammar.hpp SchemaValidator.cpp
                        TraverseSchema.cpp
  Log:
  Stateless Grammar: ValidationContext
  
  Revision  Changes    Path
  1.16      +8 -6      
xml-xerces/c/src/xercesc/validators/schema/GeneralAttributeCheck.cpp
  
  Index: GeneralAttributeCheck.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/c/src/xercesc/validators/schema/GeneralAttributeCheck.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- GeneralAttributeCheck.cpp 20 Oct 2003 15:57:22 -0000      1.15
  +++ GeneralAttributeCheck.cpp 12 Nov 2003 20:35:31 -0000      1.16
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.16  2003/11/12 20:35:31  peiyongz
  + * Stateless Grammar: ValidationContext
  + *
    * Revision 1.15  2003/10/20 15:57:22  knoaman
    * Fix multithreading problem.
    *
  @@ -225,7 +228,7 @@
   // ---------------------------------------------------------------------------
   GeneralAttributeCheck::GeneralAttributeCheck(MemoryManager* const manager)
       : fMemoryManager(manager)
  -    , fIDRefList(0)
  +    , fValidationContext(0)
       , fIDValidator(manager)
   {
       mapElements();
  @@ -417,7 +420,7 @@
                       const XMLCh* attrVal = attribute->getNodeValue();
   
                       try {
  -                        dv->validate(attrVal);
  +                        dv->validate(attrVal, fValidationContext);
                       }
                       catch(const XMLException& excep) {
                           schema->reportSchemaError(elem, XMLUni::fgXMLErrDomain, 
XMLErrs::DisplayErrorMessage, excep.getMessage());
  @@ -550,17 +553,16 @@
           dv = fAnyURIDV;
           break;
       case DV_ID:
  -        if (fIDRefList) {
  -
  +        if (fValidationContext)
  +        {
               dv = &fIDValidator;
  -            ((IDDatatypeValidator*) dv)->setIDRefList(fIDRefList);
           }
           break;
       }
   
       if (dv) {
           try {
  -            dv->validate(attValue);
  +            dv->validate(attValue, fValidationContext);
           }
           catch(const XMLException& excep) {
               schema->reportSchemaError(elem, XMLUni::fgXMLErrDomain, 
XMLErrs::DisplayErrorMessage, excep.getMessage());
  
  
  
  1.10      +13 -3     
xml-xerces/c/src/xercesc/validators/schema/GeneralAttributeCheck.hpp
  
  Index: GeneralAttributeCheck.hpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xerces/c/src/xercesc/validators/schema/GeneralAttributeCheck.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- GeneralAttributeCheck.hpp 16 May 2003 21:43:21 -0000      1.9
  +++ GeneralAttributeCheck.hpp 12 Nov 2003 20:35:31 -0000      1.10
  @@ -72,6 +72,7 @@
   #include <xercesc/util/RefHashTableOf.hpp>
   #include <xercesc/util/ValueHashTableOf.hpp>
   #include <xercesc/validators/datatype/IDDatatypeValidator.hpp>
  +#include <xercesc/framework/ValidationContext.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -228,8 +229,12 @@
       // -----------------------------------------------------------------------
       //  Setter methods
       // -----------------------------------------------------------------------
  +
  +    //deprecated
       void setIDRefList(RefHashTableOf<XMLRefInfo>* const refList);
   
  +    inline void setValidationContext(ValidationContext* const);
  +
       // -----------------------------------------------------------------------
       //  Validation methods
       // -----------------------------------------------------------------------
  @@ -284,7 +289,7 @@
       static unsigned short                    fgElemAttTable[E_Count][A_Count];
       static const XMLCh*                      fAttNames[A_Count];
       MemoryManager*                           fMemoryManager;
  -    RefHashTableOf<XMLRefInfo>*              fIDRefList;
  +    ValidationContext*                       fValidationContext;
       IDDatatypeValidator                      fIDValidator;
   };
   
  @@ -301,10 +306,15 @@
   // ---------------------------------------------------------------------------
   //  GeneralAttributeCheck: Setter methods
   // ---------------------------------------------------------------------------
  +inline void GeneralAttributeCheck::setValidationContext(ValidationContext* const 
newValidationContext)
  +{
  +    fValidationContext = newValidationContext;
  +}
  +
   inline void
   GeneralAttributeCheck::setIDRefList(RefHashTableOf<XMLRefInfo>* const refList) {
   
  -    fIDRefList = refList;
  +    fValidationContext->setIdRefList(refList);
   }
   
   XERCES_CPP_NAMESPACE_END
  
  
  
  1.17      +9 -8      xml-xerces/c/src/xercesc/validators/schema/SchemaGrammar.cpp
  
  Index: SchemaGrammar.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaGrammar.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- SchemaGrammar.cpp 11 Nov 2003 22:48:13 -0000      1.16
  +++ SchemaGrammar.cpp 12 Nov 2003 20:35:31 -0000      1.17
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.17  2003/11/12 20:35:31  peiyongz
  + * Stateless Grammar: ValidationContext
  + *
    * Revision 1.16  2003/11/11 22:48:13  knoaman
    * Serialization of XSAnnotation.
    *
  @@ -156,6 +159,7 @@
   #include <xercesc/framework/psvi/XSAnnotation.hpp>
   
   #include <xercesc/internal/XTemplateSerializer.hpp>
  +#include <xercesc/internal/ValidationContextImpl.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -174,7 +178,7 @@
       , fAttGroupInfoRegistry(0)
       , fNamespaceScope(0)
       , fValidSubstitutionGroups(0)
  -    , fIDRefList(0)
  +    , fValidationContext(0)
       , fMemoryManager(manager)
       , fValidated(false)
       , fDatatypeRegistry(manager)
  @@ -195,7 +199,7 @@
           // fElemNonDeclPool = new (fMemoryManager) 
RefHash3KeysIdPool<SchemaElementDecl>(29, true, 128, fMemoryManager);
           fGroupElemDeclPool = new (fMemoryManager) 
RefHash3KeysIdPool<SchemaElementDecl>(109, false, 128, fMemoryManager);
           fNotationDeclPool = new (fMemoryManager) NameIdPool<XMLNotationDecl>(109, 
128, fMemoryManager);
  -        fIDRefList = new (fMemoryManager) RefHashTableOf<XMLRefInfo>(29, 
fMemoryManager);
  +        fValidationContext = new (fMemoryManager) 
ValidationContextImpl(fMemoryManager);
           fDatatypeRegistry.expandRegistryToFullSchemaSet();
   
           //REVISIT: use grammarPool to create
  @@ -327,7 +331,7 @@
       delete fAttGroupInfoRegistry;
       delete fNamespaceScope;
       delete fValidSubstitutionGroups;
  -    delete fIDRefList;
  +    delete fValidationContext;
       delete fGramDesc;
       delete fAnnotations;
   }
  @@ -373,7 +377,8 @@
   {
   
       /***
  -     * don't serialize NamespaceScope* fNamespaceScope;
  +     * don't serialize NamespaceScope*    fNamespaceScope;
  +     *                 ValidationContext* fValidationContext;
        ***/
   
       Grammar::serialize(serEng);
  @@ -414,8 +419,6 @@
           XTemplateSerializer::storeObject(fComplexTypeRegistry, serEng);
           XTemplateSerializer::storeObject(fGroupInfoRegistry, serEng);
           XTemplateSerializer::storeObject(fAttGroupInfoRegistry, serEng);
  -        //fIDRefList todo: tobe removed
  -        XTemplateSerializer::storeObject(fIDRefList, serEng);
          
           /***
            * Serialize RefHash2KeysTableOf<ElemVector>*       
fValidSubstitutionGroups;
  @@ -467,8 +470,6 @@
           XTemplateSerializer::loadObject(&fComplexTypeRegistry, 29, true, serEng);
           XTemplateSerializer::loadObject(&fGroupInfoRegistry, 29, true, serEng);
           XTemplateSerializer::loadObject(&fAttGroupInfoRegistry, 29, true, serEng);
  -        //todo: fIDRefList to be removed
  -        XTemplateSerializer::loadObject(&fIDRefList, 29, true, serEng);
          
           /***
            * Deserialize RefHash2KeysTableOf<ElemVector>*       
fValidSubstitutionGroups;
  
  
  
  1.12      +15 -2     xml-xerces/c/src/xercesc/validators/schema/SchemaGrammar.hpp
  
  Index: SchemaGrammar.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaGrammar.hpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SchemaGrammar.hpp 6 Nov 2003 19:28:11 -0000       1.11
  +++ SchemaGrammar.hpp 12 Nov 2003 20:35:31 -0000      1.12
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.12  2003/11/12 20:35:31  peiyongz
  + * Stateless Grammar: ValidationContext
  + *
    * Revision 1.11  2003/11/06 19:28:11  knoaman
    * PSVI support for annotations.
    *
  @@ -146,6 +149,7 @@
   #include <xercesc/validators/datatype/IDDatatypeValidator.hpp>
   #include <xercesc/validators/datatype/DatatypeValidatorFactory.hpp>
   #include <xercesc/framework/XMLSchemaDescription.hpp>
  +#include <xercesc/framework/ValidationContext.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  @@ -283,8 +287,12 @@
       DatatypeValidatorFactory* getDatatypeRegistry();
       NamespaceScope* getNamespaceScope() const;
       RefHash2KeysTableOf<ElemVector>* getValidSubstitutionGroups() const;
  +
  +    //deprecated
       RefHashTableOf<XMLRefInfo>* getIDRefList() const;
   
  +    ValidationContext*          getValidationContext() const;
  +
       // -----------------------------------------------------------------------
       //  Setter methods
       // -----------------------------------------------------------------------
  @@ -424,7 +432,7 @@
       RefHashTableOf<XercesAttGroupInfo>*    fAttGroupInfoRegistry;
       NamespaceScope*                        fNamespaceScope;
       RefHash2KeysTableOf<ElemVector>*       fValidSubstitutionGroups;
  -    RefHashTableOf<XMLRefInfo>*            fIDRefList;
  +    ValidationContext*                     fValidationContext;
       MemoryManager*                         fMemoryManager;
       bool                                   fValidated;
       DatatypeValidatorFactory               fDatatypeRegistry;
  @@ -483,7 +491,12 @@
   
   inline RefHashTableOf<XMLRefInfo>* SchemaGrammar::getIDRefList() const {
   
  -    return fIDRefList;
  +    return fValidationContext->getIdRefList();
  +}
  +
  +inline ValidationContext* SchemaGrammar::getValidationContext() const {
  +
  +    return fValidationContext;
   }
   
   inline XMLGrammarDescription* SchemaGrammar::getGrammarDescription() const
  
  
  
  1.42      +28 -89    xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp
  
  Index: SchemaValidator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- SchemaValidator.cpp       10 Nov 2003 21:56:54 -0000      1.41
  +++ SchemaValidator.cpp       12 Nov 2003 20:35:31 -0000      1.42
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.42  2003/11/12 20:35:31  peiyongz
  + * Stateless Grammar: ValidationContext
  + *
    * Revision 1.41  2003/11/10 21:56:54  neilg
    * make internal code use the new, stateless, method of traversing attribute lists
    *
  @@ -421,68 +424,7 @@
   
                       DatatypeValidator::ValidatorType eleDefDVType = 
fCurrentDatatypeValidator->getType();
   
  -                    // set up the entitydeclpool in ENTITYDatatypeValidator
  -                    // and the idreflist in ID/IDREFDatatypeValidator
  -                    if (eleDefDVType == DatatypeValidator::List) {
  -                        DatatypeValidator* itemDTV = 
((ListDatatypeValidator*)fCurrentDatatypeValidator)->getItemTypeDTV();
  -                        DatatypeValidator::ValidatorType itemDTVType = 
itemDTV->getType();
  -                        if (itemDTVType == DatatypeValidator::ENTITY)
  -                            
((ENTITYDatatypeValidator*)itemDTV)->setEntityDeclPool(getScanner()->getEntityDeclPool());
  -                        else if (itemDTVType == DatatypeValidator::ID)
  -                            
((IDDatatypeValidator*)itemDTV)->setIDRefList(getScanner()->getIDRefList());
  -                        else if (itemDTVType == DatatypeValidator::IDREF) {
  -                            
((IDREFDatatypeValidator*)itemDTV)->setIDRefList(getScanner()->getIDRefList());
  -                        }
  -                        else if (itemDTVType == DatatypeValidator::Union) {
  -                            RefVectorOf<DatatypeValidator>* memberDTV = 
((UnionDatatypeValidator*)itemDTV)->getMemberTypeValidators();
  -                            unsigned int memberTypeNumber = memberDTV->size();
  -                            for ( unsigned int memberIndex = 0; memberIndex < 
memberTypeNumber; ++memberIndex)
  -                            {
  -                                DatatypeValidator::ValidatorType memberDTVType = 
memberDTV->elementAt(memberIndex)->getType();
  -                                if (memberDTVType == DatatypeValidator::ENTITY)
  -                                    
((ENTITYDatatypeValidator*)memberDTV->elementAt(memberIndex))->setEntityDeclPool(getScanner()->getEntityDeclPool());
  -                                else if (memberDTVType == DatatypeValidator::ID)
  -                                    
((IDDatatypeValidator*)memberDTV->elementAt(memberIndex))->setIDRefList(getScanner()->getIDRefList());
  -                                else if (memberDTVType == DatatypeValidator::IDREF) 
{
  -                                    
((IDREFDatatypeValidator*)memberDTV->elementAt(memberIndex))->setIDRefList(getScanner()->getIDRefList());
  -                                }
  -                            }
  -                        }
  -                    }
  -                    else if (eleDefDVType == DatatypeValidator::Union) {
  -                        RefVectorOf<DatatypeValidator>* memberDTV = 
((UnionDatatypeValidator*)fCurrentDatatypeValidator)->getMemberTypeValidators();
  -                        unsigned int memberTypeNumber = memberDTV->size();
  -                        for ( unsigned int memberIndex = 0; memberIndex < 
memberTypeNumber; ++memberIndex)
  -                        {
  -                            DatatypeValidator::ValidatorType memberDTVType = 
memberDTV->elementAt(memberIndex)->getType();
  -                            if (memberDTVType == DatatypeValidator::ENTITY)
  -                                
((ENTITYDatatypeValidator*)memberDTV->elementAt(memberIndex))->setEntityDeclPool(getScanner()->getEntityDeclPool());
  -                            else if (memberDTVType == DatatypeValidator::ID)
  -                                
((IDDatatypeValidator*)memberDTV->elementAt(memberIndex))->setIDRefList(getScanner()->getIDRefList());
  -                            else if (memberDTVType == DatatypeValidator::IDREF) {
  -                                
((IDREFDatatypeValidator*)memberDTV->elementAt(memberIndex))->setIDRefList(getScanner()->getIDRefList());
  -                            }
  -                            else if (memberDTVType == DatatypeValidator::List) {
  -                                DatatypeValidator* itemDTV = 
((ListDatatypeValidator*)memberDTV->elementAt(memberIndex))->getItemTypeDTV();
  -                                DatatypeValidator::ValidatorType itemDTVType = 
itemDTV->getType();
  -                                if (itemDTVType == DatatypeValidator::ENTITY)
  -                                    
((ENTITYDatatypeValidator*)itemDTV)->setEntityDeclPool(getScanner()->getEntityDeclPool());
  -                                else if (itemDTVType == DatatypeValidator::ID)
  -                                    
((IDDatatypeValidator*)itemDTV)->setIDRefList(getScanner()->getIDRefList());
  -                                else if (itemDTVType == DatatypeValidator::IDREF) {
  -                                    
((IDREFDatatypeValidator*)itemDTV)->setIDRefList(getScanner()->getIDRefList());
  -                                }
  -                            }
  -                        }
  -                    }
  -                    else if (eleDefDVType == DatatypeValidator::ENTITY)
  -                        
((ENTITYDatatypeValidator*)fCurrentDatatypeValidator)->setEntityDeclPool(getScanner()->getEntityDeclPool());
  -                    else if (eleDefDVType == DatatypeValidator::ID)
  -                        
((IDDatatypeValidator*)fCurrentDatatypeValidator)->setIDRefList(getScanner()->getIDRefList());
  -                    else if (eleDefDVType == DatatypeValidator::IDREF) {
  -                        
((IDREFDatatypeValidator*)fCurrentDatatypeValidator)->setIDRefList(getScanner()->getIDRefList());
  -                    }
  -                    else if (eleDefDVType == DatatypeValidator::NOTATION)
  +                    if (eleDefDVType == DatatypeValidator::NOTATION)
                       {
                           // if notation, need to bind URI to notation first
                           if (!fNotationBuf)
  @@ -524,7 +466,8 @@
                               // complex type (if any)
                               if ((fCurrentDatatypeValidator != 
((SchemaElementDecl*)elemDecl)->getDatatypeValidator())
                                       && (!fTypeStack->peek() || 
(fCurrentDatatypeValidator != fTypeStack->peek()->getDatatypeValidator())))
  -                                
fCurrentDatatypeValidator->validate(elemDefaultValue);
  +                                fCurrentDatatypeValidator->validate(elemDefaultValue
  +                                                                  , 
getScanner()->getValidationContext());
   
                           }
                           else {
  @@ -543,21 +486,24 @@
                                   valid = false;
                               }
                               else
  -                                fCurrentDatatypeValidator->validate(value);
  +                                fCurrentDatatypeValidator->validate(value
  +                                                                  , 
getScanner()->getValidationContext());
                           }
                       }
                       else {
                           // no default value, then check nillable
                           if (XMLString::equals(value, XMLUni::fgZeroLenString)) {
                               if ((((SchemaElementDecl*)elemDecl)->getMiscFlags() & 
SchemaSymbols::XSD_NILLABLE) == 0)
  -                                fCurrentDatatypeValidator->validate(value);
  +                                fCurrentDatatypeValidator->validate(value
  +                                                                  , 
getScanner()->getValidationContext());
                           }
                           else if (fNil) {
                               emitError(XMLValid::NilAttrNotEmpty, 
elemDecl->getFullName());
                               valid = false;
                           }
                           else
  -                            fCurrentDatatypeValidator->validate(value);
  +                            fCurrentDatatypeValidator->validate(value
  +                                                              , 
getScanner()->getValidationContext());
                       }
                   }
               }
  @@ -635,6 +581,9 @@
                                          , const XMLElementDecl* elemDecl)
   {
   
  +    //turn on IdRefList checking
  +    getScanner()->getValidationContext()->toCheckIdRefList(true);
  +
       //
       //  Get quick refs to lot of the stuff in the passed objects in
       //  order to simplify the code below, which will reference them very
  @@ -688,18 +637,14 @@
               if (attDefDVType == DatatypeValidator::List) {
                   DatatypeValidator* itemDTV = 
((ListDatatypeValidator*)attDefDV)->getItemTypeDTV();
                   DatatypeValidator::ValidatorType itemDTVType = itemDTV->getType();
  -                if (itemDTVType == DatatypeValidator::ENTITY)
  -                    
((ENTITYDatatypeValidator*)itemDTV)->setEntityDeclPool(getScanner()->getEntityDeclPool());
  -                else if (itemDTVType == DatatypeValidator::ID) {
  -                    
((IDDatatypeValidator*)itemDTV)->setIDRefList(getScanner()->getIDRefList());
  +                if (itemDTVType == DatatypeValidator::ID) {
                       thisIsAnId = true;
                   }
                   else if (itemDTVType == DatatypeValidator::IDREF) {
                       // if in prevalidatoin, do not add attDef to IDREFList
                       if (preValidation)
  -                        ((IDREFDatatypeValidator*)itemDTV)->setIDRefList(0);
  -                    else
  -                        
((IDREFDatatypeValidator*)itemDTV)->setIDRefList(getScanner()->getIDRefList());
  +                        //todo: when to setIdRefList back to non-null
  +                        
getScanner()->getValidationContext()->toCheckIdRefList(false);
                   }
               }
               else if (attDefDVType == DatatypeValidator::Union) {
  @@ -708,33 +653,24 @@
                   for ( unsigned int memberIndex = 0; memberIndex < memberTypeNumber; 
++memberIndex)
                   {
                       DatatypeValidator::ValidatorType memberDTVType = 
memberDTV->elementAt(memberIndex)->getType();
  -                    if (memberDTVType == DatatypeValidator::ENTITY)
  -                        
((ENTITYDatatypeValidator*)memberDTV->elementAt(memberIndex))->setEntityDeclPool(getScanner()->getEntityDeclPool());
  -                    else if (memberDTVType == DatatypeValidator::ID) {
  -                        
((IDDatatypeValidator*)memberDTV->elementAt(memberIndex))->setIDRefList(getScanner()->getIDRefList());
  +                    if (memberDTVType == DatatypeValidator::ID) {
                           thisIsAnId = true;
                       }
                       else if (memberDTVType == DatatypeValidator::IDREF) {
                           // if in prevalidatoin, do not add attDef to IDREFList
                           if (preValidation)
  -                            
((IDREFDatatypeValidator*)memberDTV->elementAt(memberIndex))->setIDRefList(0);
  -                        else
  -                            
((IDREFDatatypeValidator*)memberDTV->elementAt(memberIndex))->setIDRefList(getScanner()->getIDRefList());
  +                            
getScanner()->getValidationContext()->toCheckIdRefList(false);
  +
                       }
                   }
               }
  -            else if (attDefDVType == DatatypeValidator::ENTITY)
  -                
((ENTITYDatatypeValidator*)attDefDV)->setEntityDeclPool(getScanner()->getEntityDeclPool());
               else if (attDefDVType == DatatypeValidator::ID) {
  -                
((IDDatatypeValidator*)attDefDV)->setIDRefList(getScanner()->getIDRefList());
                   thisIsAnId = true;
               }
               else if (attDefDVType == DatatypeValidator::IDREF) {
                   // if in prevalidatoin, do not add attDef to IDREFList
                   if (preValidation)
  -                    ((IDREFDatatypeValidator*)attDefDV)->setIDRefList(0);
  -                else
  -                    
((IDREFDatatypeValidator*)attDefDV)->setIDRefList(getScanner()->getIDRefList());
  +                    getScanner()->getValidationContext()->toCheckIdRefList(false);
               }
   
               // now validate the attribute value
  @@ -756,7 +692,8 @@
                   notationBuf.append(chColon);
                   notationBuf.append(&attrValue[colonPos + 1]);
   
  -                attDefDV->validate(notationBuf.getRawBuffer());
  +                attDefDV->validate(notationBuf.getRawBuffer()
  +                                 , getScanner()->getValidationContext());
               }
               else {
                   if (thisIsAnId) {
  @@ -771,7 +708,8 @@
                       else
                           fSeenId = true;
                   }
  -                attDefDV->validate(attrValue);
  +                attDefDV->validate(attrValue
  +                                 , getScanner()->getValidationContext());
               }
           }
           catch (XMLException& idve) {
  @@ -1088,6 +1026,7 @@
               if (curElem.hasAttDefs()) {
                   XMLAttDefList& attDefList = curElem.getAttDefList();
                   bool seenId = false;
  +
                   for(unsigned int i=0; i<attDefList.getAttDefCount(); i++)
                   {
                       const XMLAttDef& curAttDef = attDefList.getAttDef(i);
  
  
  
  1.93      +17 -10    xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp
  
  Index: TraverseSchema.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- TraverseSchema.cpp        7 Nov 2003 17:08:12 -0000       1.92
  +++ TraverseSchema.cpp        12 Nov 2003 20:35:31 -0000      1.93
  @@ -392,7 +392,7 @@
       gramDesc->setTargetNamespace(fTargetNSURIString);
   
       fGrammarResolver->putGrammar(fSchemaGrammar);
  -    fAttributeCheck.setIDRefList(fSchemaGrammar->getIDRefList());
  +    fAttributeCheck.setValidationContext(fSchemaGrammar->getValidationContext());
   
       // Save current schema info
       SchemaInfo* currInfo = new (fMemoryManager) SchemaInfo(0, 0, 0, fTargetNSURI, 
fScopeCount,
  @@ -1819,7 +1819,8 @@
                   }
                   else {
                       try {
  -                        anyURIDV->validate(tokenElem);
  +                        anyURIDV->validate(tokenElem
  +                                         , fSchemaGrammar->getValidationContext());
                       }
                       catch(const XMLException& excep) {
                           reportSchemaError(elem, XMLUni::fgXMLErrDomain, 
XMLErrs::DisplayErrorMessage, excep.getMessage());
  @@ -2232,7 +2233,8 @@
       if (attType == XMLAttDef::Simple && dv && valueToCheck) {
   
           try {
  -            dv->validate(valueToCheck);
  +            dv->validate(valueToCheck
  +                      , fSchemaGrammar->getValidationContext());
           }
           catch (const XMLException& excep) {
               reportSchemaError(elem, XMLUni::fgValidityDomain, 
XMLValid::DisplayErrorMessage, excep.getMessage());
  @@ -2707,10 +2709,12 @@
   
           try {
               if(validator == 0) { // in this case validate according to xs:string
  -                
fDatatypeRegistry->getDatatypeValidator(SchemaSymbols::fgDT_STRING)->validate(deflt);
  +                
fDatatypeRegistry->getDatatypeValidator(SchemaSymbols::fgDT_STRING)->validate(deflt
  +                                                                                    
        , fSchemaGrammar->getValidationContext());                    
               } else {
  -                validator->validate(deflt);
  -            }
  +                validator->validate(deflt
  +                                  , fSchemaGrammar->getValidationContext());
  +             }
           }
           catch (const XMLException& excep) {
               reportSchemaError(elem, XMLUni::fgValidityDomain, 
XMLValid::DisplayErrorMessage, excep.getMessage());
  @@ -4022,7 +4026,8 @@
               else {
   
                   try {
  -                    anyURIDV->validate(token);
  +                    anyURIDV->validate(token
  +                                     , fSchemaGrammar->getValidationContext());
                   }
                   catch(const XMLException& excep) {
                       reportSchemaError(elem, XMLUni::fgXMLErrDomain, 
XMLErrs::DisplayErrorMessage, excep.getMessage());
  @@ -5793,7 +5798,8 @@
                       }
                       else {
                           try {
  -                            attDV->validate(valueConstraint);
  +                            attDV->validate(valueConstraint
  +                                          , fSchemaGrammar->getValidationContext());
                           }
                           catch(const XMLException& excep) {
                               reportSchemaError(elem, XMLUni::fgValidityDomain, 
XMLValid::DisplayErrorMessage, excep.getMessage());
  @@ -6701,7 +6707,8 @@
           fComplexTypeRegistry = fSchemaGrammar->getComplexTypeRegistry();
           fValidSubstitutionGroups = fSchemaGrammar->getValidSubstitutionGroups();
           fNamespaceScope = fSchemaGrammar->getNamespaceScope();
  -        fAttributeCheck.setIDRefList(fSchemaGrammar->getIDRefList());
  +        
fAttributeCheck.setValidationContext(fSchemaGrammar->getValidationContext());
  +
       }
   
       fSchemaInfo = toRestore;
  
  
  

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

Reply via email to