Browse Source

* Fixed compilation with -CR

git-svn-id: trunk@21298 -
sergei 13 years ago
parent
commit
c628942e15
1 changed files with 14 additions and 6 deletions
  1. 14 6
      packages/fcl-xml/src/xmlread.pp

+ 14 - 6
packages/fcl-xml/src/xmlread.pp

@@ -92,7 +92,7 @@ uses
 
 type
   TDOMDocumentTypeEx = class(TDOMDocumentType);
-  TDOMTopNodeEx = class(TDOMNode_TopLevel);
+  TXMLDocumentEx = class(TXMLDocument);
 
   TDOMEntityEx = class(TDOMEntity);
 
@@ -290,11 +290,19 @@ begin
   begin
     if not reader.Read then
       Exit;
-    if cursor is TDOMNode_TopLevel then
-    begin
-      if reader.XMLVersion <> xmlVersionUnknown then
-        TDOMTopNodeEx(cursor).FXMLVersion := reader.XMLVersion;
-      TDOMTopNodeEx(cursor).FXMLEncoding := reader.XMLEncoding;
+    case cursor.NodeType of
+      DOCUMENT_NODE:
+        begin
+          if reader.XMLVersion <> xmlVersionUnknown then
+            TXMLDocumentEx(cursor).FXMLVersion := reader.XMLVersion;
+          TXMLDocumentEx(cursor).FXMLEncoding := reader.XMLEncoding;
+        end;
+      ENTITY_NODE:
+        begin
+          if reader.XMLVersion <> xmlVersionUnknown then
+            TDOMEntityEx(cursor).FXMLVersion := reader.XMLVersion;
+          TDOMEntityEx(cursor).FXMLEncoding := reader.XMLEncoding;
+        end;
     end;
   end;