You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2003/12/20 07:19:38 UTC

cvs commit: xml-xerces/c/src/xercesc/framework/psvi PSVIAttributeList.cpp PSVIAttributeList.hpp

neilg       2003/12/19 22:19:38

  Modified:    c/src/xercesc/framework/psvi PSVIAttributeList.cpp
                        PSVIAttributeList.hpp
  Log:
  store name/namespace of corresponding attribute in PSVIAttributeList; not all PSVIAttributes have XSAttributeDeclarations
  
  Revision  Changes    Path
  1.5       +11 -8     xml-xerces/c/src/xercesc/framework/psvi/PSVIAttributeList.cpp
  
  Index: PSVIAttributeList.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/PSVIAttributeList.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PSVIAttributeList.cpp	15 Dec 2003 17:23:48 -0000	1.4
  +++ PSVIAttributeList.cpp	20 Dec 2003 06:19:38 -0000	1.5
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.5  2003/12/20 06:19:38  neilg
  + * store name/namespace of corresponding attribute in PSVIAttributeList; not all PSVIAttributes have XSAttributeDeclarations
  + *
    * Revision 1.4  2003/12/15 17:23:48  cargilld
    * psvi updates; cleanup revisits and bug fixes
    *
  @@ -81,6 +84,8 @@
           , fAttrPos(0)
   {
       fAttrList= new (fMemoryManager) RefVectorOf<PSVIAttribute> (10, true, fMemoryManager);
  +    fAttrNameList= new (fMemoryManager) RefArrayVectorOf<XMLCh> (10, false, fMemoryManager);
  +    fAttrNSList= new (fMemoryManager) RefArrayVectorOf<XMLCh> (10, false, fMemoryManager);
   }
   
   /*
  @@ -120,7 +125,7 @@
       
       if(index >= fAttrPos)
           return 0;
  -    return fAttrList->elementAt(index)->getAttributeDeclaration()->getName();
  +    return fAttrNameList->elementAt(index);
   }
   
   /*
  @@ -135,7 +140,7 @@
   {
       if(index >= fAttrPos)
           return 0;
  -    return fAttrList->elementAt(index)->getAttributeDeclaration()->getNamespace();
  +    return fAttrNSList->elementAt(index);
   }
   
   /*
  @@ -149,11 +154,9 @@
                   , const XMLCh * attrNamespace)
   {
       for (unsigned int index=0; index <= fAttrPos; index++) {
  -        PSVIAttribute* PSVIAttr= fAttrList->elementAt(index);
  -        if (XMLString::equals(attrName,PSVIAttr->getAttributeDeclaration()->getName()) &&
  -            XMLString::equals(attrNamespace,PSVIAttr->getAttributeDeclaration()->getNamespace())) {
  -            return PSVIAttr;
  -        }
  +        if (XMLString::equals(attrName,fAttrNameList->elementAt(index))
  +                && XMLString::equals(attrNamespace,fAttrNSList->elementAt(index)))
  +            return fAttrList->elementAt(index);
       }
       return 0;
   }
  
  
  
  1.6       +30 -6     xml-xerces/c/src/xercesc/framework/psvi/PSVIAttributeList.hpp
  
  Index: PSVIAttributeList.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/PSVIAttributeList.hpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PSVIAttributeList.hpp	15 Dec 2003 17:23:48 -0000	1.5
  +++ PSVIAttributeList.hpp	20 Dec 2003 06:19:38 -0000	1.6
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.6  2003/12/20 06:19:38  neilg
  + * store name/namespace of corresponding attribute in PSVIAttributeList; not all PSVIAttributes have XSAttributeDeclarations
  + *
    * Revision 1.5  2003/12/15 17:23:48  cargilld
    * psvi updates; cleanup revisits and bug fixes
    *
  @@ -173,11 +176,16 @@
       //@{
   
       /**
  -      * returns a PSVI attribute of undetermined state and 
  +      * returns a PSVI attribute of undetermined state and given name/namespace and 
         * makes that object part of the internal list.  Intended to be called
         * during validation of an element.
  +      * @param attrName     name of this attribute
  +      * @param attrNS       URI of the attribute
  +      * @return             new, uninitialized, PSVIAttribute object
         */
  -    PSVIAttribute *getPSVIAttributeToFill();
  +    PSVIAttribute *getPSVIAttributeToFill(
  +            const XMLCh * attrName
  +            , const XMLCh * attrNS);
   
       /**
         * reset the list
  @@ -202,28 +210,44 @@
       //  handler to provide dynamically-need memory
       // fAttrList
       //  list of PSVIAttributes contained by this object
  +    // fAttrNameList
  +    //  list of the names of the initialized PSVIAttribute objects contained
  +    //  in this listing
  +    // fAttrNSList
  +    //  list of the namespaces of the initialized PSVIAttribute objects contained
  +    //  in this listing
       // fAttrPos
  -    //  current number of valid PSVIAttributes in fAttrList
  +    //  current number of initialized PSVIAttributes in fAttrList
       MemoryManager*                  fMemoryManager;    
       RefVectorOf<PSVIAttribute>*     fAttrList;
  +    RefArrayVectorOf<XMLCh>*        fAttrNameList;
  +    RefArrayVectorOf<XMLCh>*        fAttrNSList;
       unsigned int                    fAttrPos;
   };
   inline PSVIAttributeList::~PSVIAttributeList() 
   {
       delete fAttrList;
  +    delete fAttrNameList;
  +    delete fAttrNSList;
   }
   
  -inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill()
  +inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill(
  +            const XMLCh *attrName
  +            , const XMLCh * attrNS)
   {
       PSVIAttribute *retAttr = 0;
       if(fAttrPos == fAttrList->size())
       {
           retAttr = new (fMemoryManager)PSVIAttribute(fMemoryManager);
  -        fAttrList->addElement(retAttr);        
  +        fAttrList->addElement(retAttr);
  +        fAttrNameList->addElement((XMLCh *)attrName);
  +        fAttrNSList->addElement((XMLCh *)attrNS);
       }
       else
       {
           retAttr = fAttrList->elementAt(fAttrPos);
  +        fAttrNameList->setElementAt((XMLCh *)attrName, fAttrPos);
  +        fAttrNSList->setElementAt((XMLCh *)attrNS, fAttrPos);
       }
       fAttrPos++;
       return retAttr;
  
  
  

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