You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2006/04/19 08:46:18 UTC

svn commit: r395157 - /xerces/c/branches/xerces-2.7/src/xercesc/validators/DTD/DTDScanner.cpp

Author: amassari
Date: Tue Apr 18 23:46:17 2006
New Revision: 395157

URL: http://svn.apache.org/viewcvs?rev=395157&view=rev
Log:
An error was reported when a DTD defined a general entity using a parameter entity for specifying the name

Modified:
    xerces/c/branches/xerces-2.7/src/xercesc/validators/DTD/DTDScanner.cpp

Modified: xerces/c/branches/xerces-2.7/src/xercesc/validators/DTD/DTDScanner.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/validators/DTD/DTDScanner.cpp?rev=395157&r1=395156&r2=395157&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/validators/DTD/DTDScanner.cpp (original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/validators/DTD/DTDScanner.cpp Tue Apr 18 23:46:17 2006
@@ -1752,15 +1752,30 @@
         fScanner->emitError(XMLErrs::ExpectedWhitespace);
     else
         fReaderMgr->skipPastSpaces();
-    const bool isPEDecl = fReaderMgr->skippedChar(chPercent);
+    bool isPEDecl = fReaderMgr->skippedChar(chPercent);
 
     //
-    //  If a PE decl, then eat the percent and check for spaces or a
-    //  PE ref on the other side of it. At least spaces are required.
+    //  If a PE decl, then check if it is followed by a space; if it is so, 
+    //  eat the percent and check for spaces or a PE ref on the other side of it. 
+    //  Otherwise, it has to be an entity reference for a general entity.
     //
     if (isPEDecl)
     {
-        if (!checkForPERef(false, true))
+        if(!fReaderMgr->getCurrentReader()->isWhitespace(fReaderMgr->peekNextChar()))
+        {
+            isPEDecl=false;
+            while (true)
+            {
+               if (!expandPERef(false, false, true, false))
+                  fScanner->emitError(XMLErrs::ExpectedEntityRefName);
+               // And skip any more spaces in the expanded value
+               if (fReaderMgr->skippedSpace())
+                  fReaderMgr->skipPastSpaces();
+               if (!fReaderMgr->skippedChar(chPercent))
+                  break;
+            }
+        }
+        else if (!checkForPERef(false, true))
             fScanner->emitError(XMLErrs::ExpectedWhitespace);
     }
 



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