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 2003/11/20 19:05:16 UTC

cvs commit: xml-xerces/c/src/xercesc/validators/schema ComplexTypeInfo.cpp

knoaman     2003/11/20 10:05:16

  Modified:    c/src/xercesc/validators/schema ComplexTypeInfo.cpp
  Log:
  PSVI: Use a copy of the content spec node when creating the content model.
  
  Revision  Changes    Path
  1.20      +13 -12    xml-xerces/c/src/xercesc/validators/schema/ComplexTypeInfo.cpp
  
  Index: ComplexTypeInfo.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/ComplexTypeInfo.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ComplexTypeInfo.cpp	13 Nov 2003 23:20:47 -0000	1.19
  +++ ComplexTypeInfo.cpp	20 Nov 2003 18:05:16 -0000	1.20
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.20  2003/11/20 18:05:16  knoaman
  + * PSVI: Use a copy of the content spec node when creating the content model.
  + *
    * Revision 1.19  2003/11/13 23:20:47  peiyongz
    * initSize
    *
  @@ -490,6 +493,7 @@
   
       // expand the content spec first
       ContentSpecNode* aSpecNode = specNode;
  +    XMLContentModel* retModel = 0;
       if (aSpecNode) {
   
           fContentSpecOrgURI = (unsigned int*) fMemoryManager->allocate
  @@ -497,21 +501,18 @@
               fContentSpecOrgURISize * sizeof(unsigned int)
           ); //new unsigned int[fContentSpecOrgURISize];
           aSpecNode = convertContentSpecTree(aSpecNode, checkUPA);
  +        retModel = buildContentModel(aSpecNode);
           fSpecNodesToDelete->addElement(aSpecNode);
       }
       else {
  -        aSpecNode = convertContentSpecTree(fContentSpec, checkUPA);
  -        if (aSpecNode != fContentSpec) {
  -            if (!fAdoptContentSpec && (aSpecNode == fContentSpec->getFirst()))
  -                fAdoptContentSpec = false;
  -            else
  -                fAdoptContentSpec = true;
  -
  -            fContentSpec = aSpecNode;
  -        }
  +        // building content model for the complex type
  +        aSpecNode = new (fMemoryManager) ContentSpecNode(*fContentSpec);
  +        aSpecNode = convertContentSpecTree(aSpecNode, checkUPA);
  +        retModel = buildContentModel(aSpecNode);
  +        delete aSpecNode;
       }
   
  -    return buildContentModel(aSpecNode);
  +    return retModel;
   }
   
   XMLContentModel* ComplexTypeInfo::buildContentModel(ContentSpecNode* const aSpecNode)
  @@ -608,7 +609,7 @@
           );
       }
        else if (((specType & 0x0f) == ContentSpecNode::Choice)
  -          ||  (specType == ContentSpecNode::Sequence))
  +          ||  ((specType & 0x0f) == ContentSpecNode::Sequence))
       {
           //
           //  Lets see if both of the children are leafs. If so, then it has to
  @@ -698,7 +699,7 @@
       }
       else if (((curType & 0x0f) == ContentSpecNode::Choice)
           ||   (curType == ContentSpecNode::All)
  -        ||   (curType == ContentSpecNode::Sequence))
  +        ||   ((curType & 0x0f) == ContentSpecNode::Sequence))
       {
           ContentSpecNode* childNode = curNode->getFirst();
           ContentSpecNode* leftNode = convertContentSpecTree(childNode, checkUPA);
  
  
  

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