Browse Source

* fcl-xml: Fixed parsing DTD, whitespace after name is mandatory only if followed by ExternalID. Mantis #29569.

git-svn-id: trunk@33040 -
sergei 9 years ago
parent
commit
9b25ce2007
1 changed files with 9 additions and 6 deletions
  1. 9 6
      packages/fcl-xml/src/xmltextreader.pp

+ 9 - 6
packages/fcl-xml/src/xmltextreader.pp

@@ -1911,12 +1911,15 @@ begin
   CheckName;
   SetString(FDocType.FName, FName.Buffer, FName.Length);
   DTDName := FNameTable.FindOrAdd(FName.Buffer, FName.Length);
-  SkipS(True);
-  StoreLocation(Locs[0]);
-  HasAtts := ParseExternalID(FDocType.FSystemID, FDocType.FPublicID, Locs[1], False);
-  if HasAtts then
-    Locs[2] := FTokenStart;
-  SkipS;
+
+  if SkipS then
+  begin
+    StoreLocation(Locs[0]);
+    HasAtts := ParseExternalID(FDocType.FSystemID, FDocType.FPublicID, Locs[1], False);
+    if HasAtts then
+      Locs[2] := FTokenStart;
+    SkipS;
+  end;
 
   if CheckForChar('[') then
   begin