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:27:26 UTC
cvs commit: xml-xerces/c/src/internal XMLScanner.cpp
tng 01/06/04 06:27:26
Modified: c/src/internal XMLScanner.cpp
Log:
the start tag "<?xml" could be followed by (#x20 | #x9 | #xD | #xA)+. Fixed by Pei Yong Zhang.
Revision Changes Path
1.43 +23 -8 xml-xerces/c/src/internal/XMLScanner.cpp
Index: XMLScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/internal/XMLScanner.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- XMLScanner.cpp 2001/06/03 19:21:39 1.42
+++ XMLScanner.cpp 2001/06/04 13:27:26 1.43
@@ -55,7 +55,7 @@
*/
/*
- * $Id: XMLScanner.cpp,v 1.42 2001/06/03 19:21:39 jberry Exp $
+ * $Id: XMLScanner.cpp,v 1.43 2001/06/04 13:27:26 tng Exp $
*/
@@ -811,7 +811,7 @@
// And invalidate any tokens by bumping our sequence number
fSequenceId++;
-
+
// Reset our error count
fErrorCount = 0;
}
@@ -949,7 +949,7 @@
{
// Bump the error count
++fErrorCount;
-
+
if (fErrorReporter)
{
// Load the message into a local for display
@@ -1000,7 +1000,7 @@
{
// Bump the error count
++fErrorCount;
-
+
if (fErrorReporter)
{
//
@@ -1054,7 +1054,7 @@
{
// Bump the error count
++fErrorCount;
-
+
if (fErrorReporter)
{
//
@@ -1986,18 +1986,33 @@
// Ok, it could be the xml decl, a comment, the doc type line,
// or the start of the root element.
//
- if (fReaderMgr.skippedString(XMLUni::fgXMLDeclStringSpace))
+ if (fReaderMgr.skippedString(XMLUni::fgXMLDeclString))
{
//
- // If we are not at line 1, col 7, then the decl was not
+ // If we are not at line 1, col 6, then the decl was not
// the first text, so its invalid.
//
const XMLReader* curReader = fReaderMgr.getCurrentReader();
if ((curReader->getLineNumber() != 1)
- || (curReader->getColumnNumber() != 7))
+ || (curReader->getColumnNumber() != 6))
{
emitError(XMLErrs::XMLDeclMustBeFirst);
}
+
+ //
+ // [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())
+ {
+ emitError(XMLErrs::XMLDeclMustBeFirst);
+ }
+
scanXMLDecl(Decl_XML);
}
else if (fReaderMgr.skippedString(XMLUni::fgPIString))
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org