You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2001/10/15 21:29:26 UTC

cvs commit: xml-xerces/c/src/validators/schema GeneralAttributeCheck.cpp GeneralAttributeCheck.hpp TraverseSchema.cpp TraverseSchema.hpp

knoaman     01/10/15 12:29:26

  Modified:    c/src/validators/schema GeneralAttributeCheck.cpp
                        GeneralAttributeCheck.hpp TraverseSchema.cpp
                        TraverseSchema.hpp
  Log:
  Add support for <notation> declaration.
  
  Revision  Changes    Path
  1.7       +32 -27    xml-xerces/c/src/validators/schema/GeneralAttributeCheck.cpp
  
  Index: GeneralAttributeCheck.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/GeneralAttributeCheck.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- GeneralAttributeCheck.cpp	2001/09/18 14:41:56	1.6
  +++ GeneralAttributeCheck.cpp	2001/10/15 19:29:26	1.7
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: GeneralAttributeCheck.cpp,v $
  + * Revision 1.7  2001/10/15 19:29:26  knoaman
  + * Add support for <notation> declaration.
  + *
    * Revision 1.6  2001/09/18 14:41:56  knoaman
    * Add support for <annotation>.
    *
  @@ -202,11 +205,11 @@
   
       fAttributes[Att_Base_R] = 
           new AttributeInfo(SchemaSymbols::fgATT_BASE, Att_Required,
  -                          0, 0);
  +                          0, DT_QName);
   
       fAttributes[Att_Base_N] = 
           new AttributeInfo(SchemaSymbols::fgATT_BASE, Att_Optional_NoDefault,
  -                          0, 0);
  +                          0, DT_QName);
   
       fAttributes[Att_Block_N] =
           new AttributeInfo(SchemaSymbols::fgATT_BLOCK, Att_Optional_NoDefault,
  @@ -222,7 +225,7 @@
   
       fAttributes[Att_Default_N] =
           new AttributeInfo(SchemaSymbols::fgATT_DEFAULT, Att_Optional_NoDefault,
  -                          0, 0);
  +                          0, DT_String);
   
       fAttributes[Att_Element_FD_D] =
           new AttributeInfo(SchemaSymbols::fgATT_ELEMENTFORMDEFAULT, Att_Optional_Default,
  @@ -242,7 +245,7 @@
   
       fAttributes[Att_Fixed_N] =
           new AttributeInfo(SchemaSymbols::fgATT_FIXED, Att_Optional_NoDefault,
  -                          0, 0);
  +                          0, DT_String);
   
       fAttributes[Att_Fixed_D] =
           new AttributeInfo(SchemaSymbols::fgATT_FIXED, Att_Optional_Default,
  @@ -258,7 +261,7 @@
   
       fAttributes[Att_ItemType_N] =
           new AttributeInfo(SchemaSymbols::fgATT_ITEMTYPE, Att_Optional_NoDefault,
  -                          0, 0);
  +                          0, DT_QName);
   
       fAttributes[Att_MaxOccurs_D] =
           new AttributeInfo(SchemaSymbols::fgATT_MAXOCCURS, Att_Optional_Default,
  @@ -314,11 +317,11 @@
   
       fAttributes[Att_Ref_R] =
           new AttributeInfo(SchemaSymbols::fgATT_REF, Att_Required,
  -                          0, 0);
  +                          0, DT_QName);
   
       fAttributes[Att_Refer_R] =
           new AttributeInfo(SchemaSymbols::fgATT_REFER, Att_Required,
  -                          0, 0);
  +                          0, DT_QName);
   
       fAttributes[Att_Schema_L_R] =
           new AttributeInfo(SchemaSymbols::fgATT_SCHEMALOCATION, Att_Required,
  @@ -330,15 +333,15 @@
   
       fAttributes[Att_Source_N] =
           new AttributeInfo(SchemaSymbols::fgATT_SOURCE, Att_Optional_NoDefault,
  -                          0, 0);
  +                          0, DT_AnyURI);
   
       fAttributes[Att_Substitution_G_N] =
           new AttributeInfo(SchemaSymbols::fgATT_SUBSTITUTIONGROUP, Att_Optional_NoDefault,
  -                          0, 0);
  +                          0, DT_QName);
   
       fAttributes[Att_System_N] =
           new AttributeInfo(SchemaSymbols::fgATT_SYSTEM, Att_Optional_NoDefault,
  -                          0, 0);
  +                          0, DT_AnyURI);
           
       fAttributes[Att_Target_N_N] =
           new AttributeInfo(SchemaSymbols::fgATT_TARGETNAMESPACE, Att_Optional_NoDefault,
  @@ -346,7 +349,7 @@
   
       fAttributes[Att_Type_N] =
           new AttributeInfo(SchemaSymbols::fgATT_TYPE, Att_Optional_NoDefault,
  -                          0, 0);
  +                          0, DT_QName);
   
       fAttributes[Att_Use_D] =
           new AttributeInfo(SchemaSymbols::fgATT_USE, Att_Optional_Default,
  @@ -492,6 +495,14 @@
       attList->addElement(fAttributes[Att_ID_N]);
       fElementMap->put((void*) SchemaSymbols::fgELT_ANNOTATION, prefixContext, attList);
   
  +    // element "notation" - global
  +    attList = new RefVectorOf<AttributeInfo>(4, false);
  +    attList->addElement(fAttributes[Att_ID_N]);
  +    attList->addElement(fAttributes[Att_Name_R]);
  +    attList->addElement(fAttributes[Att_Public_R]);
  +    attList->addElement(fAttributes[Att_System_N]);
  +    fElementMap->put((void*) SchemaSymbols::fgELT_NOTATION, prefixContext, attList);
  +
       // element "attribute" - local ref
       prefixContext = localRefPrefix;
       attList = new RefVectorOf<AttributeInfo>(5, false);
  @@ -741,12 +752,6 @@
   
       // element "field" - local name
   
  -    // element "notation" - local name
  -
  -    // element "appinfo" - local name
  -
  -    // element "documentation" - local name
  -
   }
   
   // ---------------------------------------------------------------------------
  @@ -828,6 +833,7 @@
   
       unsigned int           size = elemAttrs->size();
       RefHashTableOf<XMLCh>  attNameList(5);
  +    XMLBuffer              aBuffer(128);
   
       for (unsigned int i=0; i< size; i++) {
   
  @@ -843,8 +849,8 @@
   
               if (attValueLen > 0) {
   
  -                fBuffer.set(attValue.rawBuffer(), attValueLen);
  -                validate(attName, fBuffer.getRawBuffer(),
  +                aBuffer.set(attValue.rawBuffer(), attValueLen);
  +                validate(attName, aBuffer.getRawBuffer(),
                            attInfo->getValidatorIndex(), schema);
               }
               else {
  @@ -872,8 +878,8 @@
   
           // Bypass attributes that start with xml 
           DOMString attName = attribute.getNodeName();
  -        fBuffer.set(attName.rawBuffer(), attName.length());
  -        XMLCh* tmpName = fBuffer.getRawBuffer();
  +        aBuffer.set(attName.rawBuffer(), attName.length());
  +        XMLCh* tmpName = aBuffer.getRawBuffer();
   
           if ((*tmpName == chLatin_X || *tmpName == chLatin_x)
              && (*(tmpName+1) == chLatin_M || *(tmpName+1) == chLatin_m)
  @@ -882,11 +888,11 @@
           }
   
           attName = attribute.getLocalName();
  -        fBuffer.set(attName.rawBuffer(), attName.length());
  +        aBuffer.set(attName.rawBuffer(), attName.length());
   
  -        if (!attNameList.containsKey(fBuffer.getRawBuffer())) {
  +        if (!attNameList.containsKey(aBuffer.getRawBuffer())) {
               schema->reportSchemaError(XMLUni::fgXMLErrDomain,
  -                XMLErrs::AttributeDisallowed, fBuffer.getRawBuffer(), contextStr, elemName);
  +                XMLErrs::AttributeDisallowed, aBuffer.getRawBuffer(), contextStr, elemName);
           }
       }
   }
  @@ -963,9 +969,8 @@
       }
   
       if (isInvalid) {
  -              schema->reportSchemaError(XMLUni::fgXMLErrDomain, 
  -                                      XMLErrs::InvalidAttValue,
  -                                      attValue, attName);
  +        schema->reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::InvalidAttValue,
  +                                  attValue, attName);
       }
   }
   
  
  
  
  1.4       +3 -4      xml-xerces/c/src/validators/schema/GeneralAttributeCheck.hpp
  
  Index: GeneralAttributeCheck.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/GeneralAttributeCheck.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GeneralAttributeCheck.hpp	2001/06/06 13:09:04	1.3
  +++ GeneralAttributeCheck.hpp	2001/10/15 19:29:26	1.4
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: GeneralAttributeCheck.hpp,v 1.3 2001/06/06 13:09:04 knoaman Exp $
  + * $Id: GeneralAttributeCheck.hpp,v 1.4 2001/10/15 19:29:26 knoaman Exp $
    */
   
   #if !defined(GENERALATTRIBUTECHECK_HPP)
  @@ -73,7 +73,6 @@
   #include <util/RefVectorOf.hpp>
   #include <util/RefHashTableOf.hpp>
   #include <util/RefHash2KeysTableOf.hpp>
  -#include <framework/XMLBuffer.hpp>
   #include <dom/DOM_Element.hpp>
   
   // ---------------------------------------------------------------------------
  @@ -253,11 +252,12 @@
   
       // datatype validators
       enum {
  +        DT_String,
  +        DT_Token,
           DT_AnyURI,
           DT_ID,
           DT_NonNegInt,
           DT_QName,
  -        DT_Token,
           DT_Boolean,
   
           // add XPath
  @@ -284,7 +284,6 @@
       AttributeInfo**                                fAttributes;
       DatatypeValidator**                            fValidators;
       RefHash2KeysTableOf<RefVectorOfAttributeInfo>* fElementMap;
  -    XMLBuffer                                      fBuffer;
       static GeneralAttributeCheck* fInstance;
   };
   
  
  
  
  1.52      +131 -33   xml-xerces/c/src/validators/schema/TraverseSchema.cpp
  
  Index: TraverseSchema.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/TraverseSchema.cpp,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- TraverseSchema.cpp	2001/10/04 15:08:56	1.51
  +++ TraverseSchema.cpp	2001/10/15 19:29:26	1.52
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: TraverseSchema.cpp,v 1.51 2001/10/04 15:08:56 knoaman Exp $
  + * $Id: TraverseSchema.cpp,v 1.52 2001/10/15 19:29:26 knoaman Exp $
    */
   
   // ---------------------------------------------------------------------------
  @@ -202,6 +202,7 @@
       , fGlobalAttributes(0)
       , fGlobalGroups(0)
       , fGlobalAttGroups(0)
  +    , fNotationRegistry(0)
       , fRedefineComponents(0)
       , fSubstitutionGroups(0)
       , fValidSubstitutionGroups(0)
  @@ -904,12 +905,12 @@
       fBuffer.append(chComma);
       fBuffer.append(name);
   
  -    XMLCh* fullName = fBuffer.getRawBuffer();
  -    int    fullTypeNameId = fStringPool->addOrFind(fullName);
  +    int    fullTypeNameId = fStringPool->addOrFind(fBuffer.getRawBuffer());
  +    const XMLCh* fullName = fStringPool->getValueForId(fullTypeNameId);
   
       //check if we have already traversed the same simpleType decl
       if (fDatatypeRegistry->getDatatypeValidator(fullName)!= 0) {
  -        return fStringPool->addOrFind(fullName);
  +        return fullTypeNameId;
       }
   
       // Circular constraint checking
  @@ -1024,18 +1025,18 @@
       fBuffer.append(chComma);
       fBuffer.append(name);
   
  -    XMLCh* fullName = fBuffer.getRawBuffer();
  +    int typeNameIndex = fStringPool->addOrFind(fBuffer.getRawBuffer());
  +    const XMLCh* fullName = fStringPool->getValueForId(typeNameIndex);
       if (topLevel) {
   
           ComplexTypeInfo* temp = fComplexTypeRegistry->get(fullName);
   
           if (temp != 0 ) {
  -            return fStringPool->addOrFind(fullName);
  +            return typeNameIndex;
           }
       }
   
       ComplexTypeInfo* typeInfo = new ComplexTypeInfo();
  -    int typeNameIndex = fStringPool->addOrFind(fullName);
       int previousScope = fCurrentScope;
       fCurrentScope = fScopeCount++;
   
  @@ -1050,8 +1051,7 @@
       // ------------------------------------------------------------------
       // Register the type first, so that in case of a recursive element type
       // declaration, we can retrieve the complexType info (though the rest of
  -    fComplexTypeRegistry->put((void*) fStringPool->getValueForId(typeNameIndex),
  -                              typeInfo);
  +    fComplexTypeRegistry->put((void*) fullName, typeInfo);
       typeInfo->setTypeName(fullName);
       typeInfo->setScopeDefined(fCurrentScope);
       fCurrentTypeNameStack->addElement(typeNameIndex);
  @@ -1214,7 +1214,8 @@
       fBuffer.append(name);
   
       unsigned int nameIndex = fStringPool->addOrFind(fBuffer.getRawBuffer());
  -    XercesGroupInfo* groupInfo = fGroupRegistry->get(fStringPool->getValueForId(nameIndex));
  +    const XMLCh* fullName = fStringPool->getValueForId(nameIndex);
  +    XercesGroupInfo* groupInfo = fGroupRegistry->get(fullName);
   
       if (groupInfo) {
           return groupInfo;
  @@ -1222,7 +1223,6 @@
   
       int saveScope = fCurrentScope;
   //    unsigned int fullNameIndex = fStringPool->addOrFind(fBuffer.getRawBuffer());
  -    const XMLCh* fullName = fStringPool->getValueForId(nameIndex);
       ContentSpecNode* specNode = 0;
       XercesGroupInfo* saveGroupInfo = fCurrentGroupInfo;
       
  @@ -2402,10 +2402,86 @@
       return new QName(elemDecl->getElementName());
   }
   
  -XMLCh* TraverseSchema::traverseNotationDecl(const DOM_Element& childElem) {
  +const XMLCh* TraverseSchema::traverseNotationDecl(const DOM_Element& elem) {
   
  -    //REVISIT
  -    return 0;
  +    // ------------------------------------------------------------------
  +    // Check attributes
  +    // ------------------------------------------------------------------
  +    fAttributeCheck->checkAttributes(elem, GeneralAttributeCheck::GlobalContext, this);
  +
  +    // ------------------------------------------------------------------
  +    // Process notation attributes/elements
  +    // ------------------------------------------------------------------
  +    const XMLCh* name = getElementAttValue(elem, SchemaSymbols::fgATT_NAME);
  +    bool         nameEmpty = (XMLString::stringLen(name) == 0) ? true : false;
  +
  +    if (nameEmpty) {
  +        reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::NoNameGlobalElement,
  +                          SchemaSymbols::fgELT_NOTATION);
  +        return 0;
  +    }
  +
  +    if (fNotationRegistry->containsKey(name, fTargetNSURI)) {
  +        return name;
  +    }
  +
  +    const XMLCh* publicId = getElementAttValue(elem, SchemaSymbols::fgATT_PUBLIC);
  +    const XMLCh* systemId = getElementAttValue(elem, SchemaSymbols::fgATT_SYSTEM);
  +
  +    if (XMLString::stringLen(publicId) == 0 && XMLString::stringLen(systemId) == 0) {
  +        reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::Notation_InvalidDecl, name);
  +    }
  +
  +    fNotationRegistry->put((void*) name, fTargetNSURI, 0);
  +
  +    //we don't really care if something inside <notation> is wrong..
  +    checkContent(elem, XUtil::getFirstChildElement(elem), true);
  +
  +    return name;    
  +}
  +
  +const XMLCh* TraverseSchema::traverseNotationDecl(const XMLCh* const name,
  +                                                  const XMLCh* const uriStr) {
  +
  +    unsigned int uriId = fURIStringPool->addOrFind(uriStr); 
  +    SchemaInfo*  saveInfo = fSchemaInfo;
  +
  +    if (fTargetNSURI != (int) uriId) {
  +
  +        Grammar* grammar = fGrammarResolver->getGrammar(uriStr);
  +
  +        if (grammar == 0 || grammar->getGrammarType() != Grammar::SchemaGrammarType) {
  +
  +            reportSchemaError(XMLUni::fgValidityDomain, XMLValid::GrammarNotFound, uriStr);
  +            return 0;
  +        }
  +
  +        SchemaInfo* impInfo = fSchemaInfo->getImportInfo(uriId);
  +
  +        if (!impInfo) {
  +
  +            reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, uriStr, name);
  +            return 0;
  +        }
  +
  +        fSchemaInfo = impInfo;
  +        fTargetNSURI = fSchemaInfo->getTargetNSURI();
  +    }
  +
  +    DOM_Element notationElem = fSchemaInfo->getTopLevelComponent(SchemaSymbols::fgELT_NOTATION, name, &fSchemaInfo);
  +
  +    if (notationElem == 0) {
  +
  +        reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::Notation_DeclNotFound, uriStr, name);
  +        return 0;
  +    }
  +
  +    const XMLCh* notationName = traverseNotationDecl(notationElem);
  +
  +    fSchemaInfo = saveInfo;
  +    fTargetNSURI = fSchemaInfo->getTargetNSURI();
  +
  +    return notationName;
   }
   
   int TraverseSchema::traverseByList(const DOM_Element& rootElem,
  @@ -2470,7 +2546,8 @@
       }
   
       // create & register validator for "generated" type if it doesn't exist
  -    XMLCh* qualifiedName = getQualifiedName(typeNameIndex);
  +    int strId = fStringPool->addOrFind(getQualifiedName(typeNameIndex));
  +    const XMLCh* qualifiedName = fStringPool->getValueForId(strId);
   
       try {
   
  @@ -2479,9 +2556,8 @@
   
           if (newValidator == 0) {
   
  -            int strId = fStringPool->addOrFind(qualifiedName);
               fDatatypeRegistry->createDatatypeValidator(
  -                  fStringPool->getValueForId(strId), baseValidator, 0, 0, true, finalSet);
  +                  qualifiedName, baseValidator, 0, 0, true, finalSet);
           }
       }
       catch(const InvalidDatatypeValueException& idve) {
  @@ -2497,7 +2573,7 @@
                             XMLErrs::DatatypeValidatorCreationError, typeName);
       }
   
  -    return resetCurrentTypeNameStack(fStringPool->addOrFind(qualifiedName));
  +    return resetCurrentTypeNameStack(strId);
   }
   
   int TraverseSchema::traverseByRestriction(const DOM_Element& rootElem,
  @@ -2585,6 +2661,25 @@
                   }
   
                   fBuffer.set(attValue.rawBuffer(), attValueLen);
  +
  +                if (baseValidator->getType() == DatatypeValidator::NOTATION) {
  +
  +                    unsigned int enumValId = fStringPool->addOrFind(fBuffer.getRawBuffer());
  +                    const XMLCh* const enumVal = fStringPool->getValueForId(enumValId);
  +                    const XMLCh* localPart = getLocalPart(enumVal);
  +                    const XMLCh* prefix = getPrefix(enumVal);
  +                    const XMLCh* uriStr = (prefix) ? resolvePrefixToURI(prefix) : fTargetNSURIString;
  +                    unsigned int uriId = fURIStringPool->addOrFind(uriStr);
  +
  +                    if (!fNotationRegistry->containsKey(localPart, uriId)) {
  +                        traverseNotationDecl(localPart, uriStr);
  +                    }
  +
  +                    fBuffer.set(uriStr);
  +                    fBuffer.append(chColon);
  +                    fBuffer.append(localPart);
  +                }
  +
                   enums->addElement(XMLString::replicate(fBuffer.getRawBuffer()));
               }
               else if (XMLString::compareString(facetStr,
  @@ -2652,7 +2747,8 @@
                       new KVStringPair(SchemaSymbols::fgATT_FIXED, fixedFlagStr));
       }
   
  -    XMLCh* qualifiedName = getQualifiedName(typeNameIndex);
  +    int strId = fStringPool->addOrFind(getQualifiedName(typeNameIndex));
  +    const XMLCh* qualifiedName = fStringPool->getValueForId(strId);
   
       try {
   
  @@ -2661,10 +2757,8 @@
   
           if (newValidator == 0) {
   
  -            int strId = fStringPool->addOrFind(qualifiedName);
               fDatatypeRegistry->createDatatypeValidator
  -                   (fStringPool->getValueForId(strId), baseValidator, facets,
  -                    enums, false, finalSet);
  +                   (qualifiedName, baseValidator, facets, enums, false, finalSet);
           }
       }
       catch(const InvalidDatatypeValueException& idve) {
  @@ -2681,7 +2775,7 @@
                             XMLErrs::DatatypeValidatorCreationError, typeName);
       }
   
  -    return resetCurrentTypeNameStack(fStringPool->addOrFind(qualifiedName));
  +    return resetCurrentTypeNameStack(strId);
   }
   
   
  @@ -2763,7 +2857,8 @@
           content   = XUtil::getNextSiblingElement(content);
       } // end while
   
  -    XMLCh* qualifiedName = getQualifiedName(typeNameIndex);
  +    int strId = fStringPool->addOrFind(getQualifiedName(typeNameIndex));
  +    const XMLCh* qualifiedName = fStringPool->getValueForId(strId);
   
       try {
   
  @@ -2772,9 +2867,8 @@
   
           if (newValidator == 0) {
   
  -            int strId = fStringPool->addOrFind(qualifiedName);
               if (fDatatypeRegistry->createDatatypeValidator(
  -                           fStringPool->getValueForId(strId), validators, finalSet) != 0) {
  +                           qualifiedName, validators, finalSet) != 0) {
                   janValidators.orphan();
               }
           }
  @@ -2795,7 +2889,7 @@
                             XMLErrs::DatatypeValidatorCreationError, typeName);
       }
   
  -    return resetCurrentTypeNameStack(fStringPool->addOrFind(qualifiedName));
  +    return resetCurrentTypeNameStack(strId);
   }
   
   
  @@ -3080,18 +3174,16 @@
                           new KVStringPair(SchemaSymbols::fgATT_FIXED, fixedFlagStr));
                   }
   
  -                XMLCh* qualifiedName =
  -                    getQualifiedName(fStringPool->addOrFind(typeName));
  +                int nameId = fStringPool->addOrFind(getQualifiedName(fStringPool->addOrFind(typeName)));
  +                const XMLCh* qualifiedName = fStringPool->getValueForId(nameId);
   
                   try {
   
  -                    int nameId = fStringPool->addOrFind(qualifiedName);
  -
                       typeInfo->setDatatypeValidator
                       (
                           fDatatypeRegistry->createDatatypeValidator
                           (
  -                            fStringPool->getValueForId(nameId),
  +                            qualifiedName,
                               typeInfo->getBaseDatatypeValidator(),
                               facets, enums, false, 0
                           )
  @@ -3564,7 +3656,7 @@
               traverseGroupDecl(child);
           }
           else if (name.equals(SchemaSymbols::fgELT_NOTATION)) {
  -            traverseNotationDecl(child); //TO DO
  +            traverseNotationDecl(child);
           } else {
               reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::SchemaElementContentError);
           }
  @@ -4187,6 +4279,10 @@
                   reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, nameURI, localPart);
               }
           }
  +        else {
  +            noErrorDetected = false;
  +            reportSchemaError(XMLUni::fgXMLErrDomain, XMLErrs::TypeNotFound, nameURI, localPart);
  +        }
       }
   
       // restore schema information, if necessary
  @@ -6810,6 +6906,7 @@
       fGlobalAttributes = new RefHash2KeysTableOf<XMLCh>(13, false);
       fGlobalGroups = new RefHash2KeysTableOf<XMLCh>(13, false);
       fGlobalAttGroups = new RefHash2KeysTableOf<XMLCh>(13, false);
  +    fNotationRegistry = new RefHash2KeysTableOf<XMLCh>(13, false);
       fSubstitutionGroups = new RefHash2KeysTableOf<SchemaElementDecl>(29, false);
       fSchemaInfoList = new RefHashTableOf<SchemaInfo>(29);
   }
  @@ -6823,6 +6920,7 @@
       delete fGlobalAttributes;
       delete fGlobalGroups;
       delete fGlobalAttGroups;
  +    delete fNotationRegistry;
       delete fRedefineComponents;
       delete fSubstitutionGroups;
       delete fRefElements;
  
  
  
  1.23      +11 -17    xml-xerces/c/src/validators/schema/TraverseSchema.hpp
  
  Index: TraverseSchema.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/TraverseSchema.hpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- TraverseSchema.hpp	2001/10/04 15:08:56	1.22
  +++ TraverseSchema.hpp	2001/10/15 19:29:26	1.23
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: TraverseSchema.hpp,v 1.22 2001/10/04 15:08:56 knoaman Exp $
  + * $Id: TraverseSchema.hpp,v 1.23 2001/10/15 19:29:26 knoaman Exp $
    */
   
   #if !defined(TRAVERSESCHEMA_HPP)
  @@ -173,7 +173,9 @@
                                           const int finalSet,
                                           int baseRefContext);
       QName*              traverseElementDecl(const DOM_Element& childElem, bool& toDelete);
  -    XMLCh*              traverseNotationDecl(const DOM_Element& childElem);
  +    const XMLCh*        traverseNotationDecl(const DOM_Element& childElem);
  +    const XMLCh*        traverseNotationDecl(const XMLCh* const name,
  +                                             const XMLCh* const uriStr);
       ContentSpecNode*    traverseChoiceSequence(const DOM_Element& elemDecl,
                                                  const int modelGroupType);
       ContentSpecNode*    traverseAny(const DOM_Element& anyDecl);
  @@ -699,6 +701,7 @@
       RefHash2KeysTableOf<XMLCh>*             fGlobalAttributes;
       RefHash2KeysTableOf<XMLCh>*             fGlobalGroups;
       RefHash2KeysTableOf<XMLCh>*             fGlobalAttGroups;
  +    RefHash2KeysTableOf<XMLCh>*             fNotationRegistry;
       RefHash2KeysTableOf<XMLCh>*             fRedefineComponents;
       RefHash2KeysTableOf<SchemaElementDecl>* fSubstitutionGroups;
       RefHash2KeysTableOf<ElemVector>*        fValidSubstitutionGroups;
  @@ -721,12 +724,9 @@
           return XMLUni::fgZeroLenString;
       }
   
  -    fBuffer.set(rawName, colonIndex + 1);
  -    XMLString::subString(fBuffer.getRawBuffer(), rawName, 0, colonIndex);
  +    fBuffer.set(rawName, colonIndex);
   
  -    unsigned int nameId = fStringPool->addOrFind(fBuffer.getRawBuffer());
  -
  -    return fStringPool->getValueForId(nameId);
  +    return fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer()));
   }
   
   inline const XMLCh* TraverseSchema::getLocalPart(const XMLCh* const rawName) {
  @@ -743,14 +743,10 @@
       }
       else {
   
  -        fBuffer.set(rawName, rawNameLen - colonIndex);
  -        XMLString::subString(fBuffer.getRawBuffer(), rawName,
  -                             colonIndex + 1, rawNameLen);
  +        fBuffer.set(rawName + colonIndex + 1, rawNameLen - colonIndex - 1);
       }
  -
  -    unsigned int nameId = fStringPool->addOrFind(fBuffer.getRawBuffer());
   
  -    return fStringPool->getValueForId(nameId);
  +    return fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer()));
   }
   
   inline bool
  @@ -827,10 +823,8 @@
       XMLString::binToText(fAnonXSTypeCount++, anonCountStr, 15, 10);
       fBuffer.set(prefix);
       fBuffer.append(anonCountStr);
  -
  -    int anonTypeId = fStringPool->addOrFind(fBuffer.getRawBuffer());
   
  -    return fStringPool->getValueForId(anonTypeId);
  +    return fStringPool->getValueForId(fStringPool->addOrFind(fBuffer.getRawBuffer()));
   }
   
   inline int TraverseSchema::resetCurrentTypeNameStack(const int value) {
  @@ -870,7 +864,7 @@
       newTypeName.set(oldTypeName);
   
       for (int i=0; i < redefineCounter; i++) {
  -        fBuffer.append(SchemaSymbols::fgRedefIdentifier);
  +        newTypeName.append(SchemaSymbols::fgRedefIdentifier);
       }
   }
   
  
  
  

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