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 2002/02/26 22:06:53 UTC

cvs commit: xml-xerces/c/src/xercesc/validators/DTD DTDScanner.cpp

knoaman     02/02/26 13:06:53

  Modified:    c/src/xercesc/validators/DTD DTDScanner.cpp
  Log:
  Create ZeroOrOne node only if needed.
  
  Revision  Changes    Path
  1.2       +19 -8     xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.cpp
  
  Index: DTDScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DTDScanner.cpp	1 Feb 2002 22:22:44 -0000	1.1
  +++ DTDScanner.cpp	26 Feb 2002 21:06:53 -0000	1.2
  @@ -56,8 +56,11 @@
   
   /*
    * $Log: DTDScanner.cpp,v $
  - * Revision 1.1  2002/02/01 22:22:44  peiyongz
  - * Initial revision
  + * Revision 1.2  2002/02/26 21:06:53  knoaman
  + * Create ZeroOrOne node only if needed.
  + *
  + * Revision 1.1.1.1  2002/02/01 22:22:44  peiyongz
  + * sane_include
    *
    * Revision 1.25  2002/01/24 16:30:50  tng
    * [Bug 3111] Problem with LexicalHandler::startDTD() and LexicalHandler::endDTD() .
  @@ -3413,19 +3416,27 @@
                       return false;
                   }
   
  -                if (!fReaderMgr->skippedChar(chAsterisk) && starRequired)
  -                    fScanner->emitError(XMLErrs::ExpectedAsterisk);
  +                bool starSkipped = true;
  +                if (!fReaderMgr->skippedChar(chAsterisk)) {
  +
  +                    starSkipped = false;
  +
  +                    if (starRequired)
  +                        fScanner->emitError(XMLErrs::ExpectedAsterisk);
  +                }
   
                   //
                   //  Create a zero or more node and make the original head
                   //  node its first child.
                   //
  -                headNode = new ContentSpecNode
  -                (
  -                    ContentSpecNode::ZeroOrMore
  -                    , headNode
  -                    , 0
  -                );
  +                if (starRequired || starSkipped) {
  +                    headNode = new ContentSpecNode
  +                    (
  +                        ContentSpecNode::ZeroOrMore
  +                        , headNode
  +                        , 0
  +                    );
  +                }
   
                   // Store the head node as the content spec of the element.
                   toFill.setContentSpec(headNode);
  
  
  

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