peiyongz    2004/04/29 13:19:10

  Modified:    c/src/xercesc/validators/DTD DTDValidator.cpp
  Log:
  XML1.0-3rd: only and only ONE #x20 is allowed to be the delimiter for
  Names and Nmtokens
  
  Revision  Changes    Path
  1.23      +15 -6     xml-xerces/c/src/xercesc/validators/DTD/DTDValidator.cpp
  
  Index: DTDValidator.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDValidator.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- DTDValidator.cpp  21 Apr 2004 18:00:13 -0000      1.22
  +++ DTDValidator.cpp  29 Apr 2004 20:19:10 -0000      1.23
  @@ -315,7 +315,7 @@
           {
               // If its not, emit and error but try to keep going
               if (!getReaderMgr()->getCurrentReader()->isFirstNameChar(*valPtr))
  -                emitError(XMLValid::AttrValNotName, fullName);
  +                emitError(XMLValid::AttrValNotName, valPtr, fullName);
               valPtr++;
           }
   
  @@ -326,13 +326,22 @@
               //  If we hit a whitespace, its either a break between two
               //  or more values, or an error if we have a single value.
               //
  -            if (getReaderMgr()->getCurrentReader()->isWhitespace(*valPtr))
  +            //
  +            //   XML1.0-3rd
  +            //
  +            //   [6]   Names   ::=   Name (#x20 Name)*
  +            //   [8]   Nmtokens   ::=   Nmtoken (#x20 Nmtoken)*
  +            //
  +            //   only and only ONE #x20 is allowed to be the delimiter
  +            //
  +            if (*valPtr==chSpace)
               {
                   if (!multipleValues)
                   {
                       emitError(XMLValid::NoMultipleValues, fullName);
                       return;
                   }
  +
                   break;
               }
   
  @@ -346,7 +355,7 @@
   
               if (!getReaderMgr()->getCurrentReader()->isNameChar(*valPtr))
               {
  -                emitError(XMLValid::AttrValNotName, fullName);
  +                emitError(XMLValid::AttrValNotName, valPtr, fullName);
                   return;
               }
               valPtr++;
  @@ -412,7 +421,7 @@
               if (decl)
               {
                   if (!decl->isUnparsed())
  -                    emitError(XMLValid::BadEntityRefAttr, fullName);
  +                    emitError(XMLValid::BadEntityRefAttr, pszTmpVal, fullName);
               }
                else
               {
  @@ -435,7 +444,7 @@
               //  this value will be legal since it matches one of them.
               //
               if (!XMLString::isInList(pszTmpVal, enumList))
  -                emitError(XMLValid::DoesNotMatchEnumList, fullName);
  +                emitError(XMLValid::DoesNotMatchEnumList, pszTmpVal, fullName);
           }
   
           // If not doing multiple values, then we are done
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to