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 2001/06/04 15:25:55 UTC

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

tng         01/06/04 06:25:52

  Modified:    c/src/validators/DTD DTDScanner.cpp
  Log:
  the start tag "<?xml" could be followed by (#x20 | #x9 | #xD | #xA)+.  Fixed by Pei Yong Zhang.
  
  Revision  Changes    Path
  1.8       +16 -1     xml-xerces/c/src/validators/DTD/DTDScanner.cpp
  
  Index: DTDScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/DTD/DTDScanner.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DTDScanner.cpp	2001/05/28 20:54:06	1.7
  +++ DTDScanner.cpp	2001/06/04 13:25:50	1.8
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: DTDScanner.cpp,v $
  + * Revision 1.8  2001/06/04 13:25:50  tng
  + * the start tag "<?xml" could be followed by (#x20 | #x9 | #xD | #xA)+.  Fixed by Pei Yong Zhang.
  + *
    * Revision 1.7  2001/05/28 20:54:06  tng
    * Schema: allocate a fDTDValidator, fSchemaValidator explicitly to avoid wrong cast
    *
  @@ -3146,7 +3149,7 @@
        else if (nextCh == chQuestion)
       {
           // It could be a PI or the XML declaration. Check for Decl
  -        bool gotDecl = fReaderMgr->skippedString(XMLUni::fgXMLStringSpace);
  +        bool gotDecl = fReaderMgr->skippedString(XMLUni::fgXMLString);
   
           //
           //  Just in case, check for upper case. If found, issue
  @@ -3164,6 +3167,18 @@
               // If we are not accepting text decls, its an error
               if (parseTextDecl)
               {
  +                // [23] XMLDecl     ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' 
  +                // [24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
  +                //
  +                // [3]  S           ::= (#x20 | #x9 | #xD | #xA)+ 
  +                //
  +                // There shall be at lease --ONE-- space in between 
  +                // the tag '<?xml' and the VersionInfo. 
  +                //
  +                if (!fReaderMgr->lookingAtSpace())
  +                {               
  +                    fScanner->emitError(XMLErrs::XMLDeclMustBeFirst);
  +                }
                   scanTextDecl();
               }
                else
  
  
  

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