You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/11/05 22:38:27 UTC

cvs commit: xml-xerces/c/src/xercesc/internal XMLScanner2.cpp

tng         2002/11/05 13:38:27

  Modified:    c/src/xercesc/internal XMLScanner2.cpp
  Log:
  Oasis test fix: Should check if content model allow character for CDataSection case.
  
  Revision  Changes    Path
  1.18      +20 -5     xml-xerces/c/src/xercesc/internal/XMLScanner2.cpp
  
  Index: XMLScanner2.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XMLScanner2.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- XMLScanner2.cpp	4 Nov 2002 14:58:19 -0000	1.17
  +++ XMLScanner2.cpp	5 Nov 2002 21:38:27 -0000	1.18
  @@ -2302,6 +2302,21 @@
               }
           }
   
  +        if (fValidate) {
  +            // And see if the current element is a 'Children' style content model
  +            const ElemStack::StackElem* topElem = fElemStack.topElement();
  +
  +            // Get the character data opts for the current element
  +            XMLElementDecl::CharDataOpts charOpts = topElem->fThisElement->getCharDataOpts();
  +
  +            if (charOpts != XMLElementDecl::AllCharData)
  +            {
  +                // They definitely cannot handle any type of char data
  +                fValidator->emitError(XMLValid::NoCharDataInCM);
  +            }
  +        }
  +
  +
           // Add it to the buffer
           bbCData.append(nextCh);
       }
  @@ -2897,12 +2912,12 @@
       }
   
       //
  -    // XML 1.0 Section 2.9
  +    // XML 1.0 Section 4.1
       //  If we are a standalone document, then it has to have been declared
  -    //  in the internal subset. Keep going though.
  +    //  in the internal subset.
       //
  -    if (fStandalone && !decl->getDeclaredInIntSubset() && fValidate)
  -        fValidator->emitError(XMLValid::IllegalRefInStandalone, bbName.getRawBuffer());
  +    if (fStandalone && !decl->getDeclaredInIntSubset())
  +        emitError(XMLErrs::IllegalRefInStandalone, bbName.getRawBuffer());
   
       if (decl->isExternal())
       {
  
  
  

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