Browse Source

* The tag name may be followed by any whitespace char, not only #32 (Mantis #16906)

git-svn-id: trunk@15551 -
sergei 15 years ago
parent
commit
83238862f7
2 changed files with 9 additions and 4 deletions
  1. 5 2
      packages/fcl-xml/src/sax_html.pp
  2. 4 2
      packages/fcl-xml/src/sax_xml.pp

+ 5 - 2
packages/fcl-xml/src/sax_html.pp

@@ -323,8 +323,11 @@ var
   DoIncJ: Boolean;
   DoIncJ: Boolean;
 begin
 begin
   Attr := nil;
   Attr := nil;
-  i := Pos(' ', s);
-  if i <= 0 then
+  i := 1;
+  while (i <= Length(s)) and not (s[i] in WhitespaceChars) do
+    Inc(i);
+
+  if i = Length(s) then
     Result := LowerCase(s)
     Result := LowerCase(s)
   else
   else
   begin
   begin

+ 4 - 2
packages/fcl-xml/src/sax_xml.pp

@@ -272,8 +272,10 @@ procedure TSAXXMLReader.EnterNewScannerContext(NewContext: TXMLScannerContext);
     DoIncJ: Boolean;
     DoIncJ: Boolean;
   begin
   begin
     Attr := nil;
     Attr := nil;
-    i := Pos(' ', s);
-    if i <= 0 then
+    i := 1;
+    while (i <= Length(s)) and not (s[i] in WhitespaceChars) do
+      Inc(i);
+    if i = Length(s) then
       Result := LowerCase(s)
       Result := LowerCase(s)
     else
     else
     begin
     begin