function GetAttribute( const Name : string ) : string;
function GetNode( Index : Integer ) : IXMLNode;
public
- constructor Create;
+ constructor Create;
+ destructor Destroy; override;
property NodeName : string read FNodeName write FNodeName;
property Attributes[ const Name : string ] : string read GetAttribute;
var node : IXMLNode
) : string; // node \88È\8aO\82Ì\83m\81[\83h\82ª\95Â\82¶\82ç\82ê\82½\8fê\8d\87\82Ì\83m\81[\83h\96¼
-function LoadXMLDocument(
- const fileName : string
-) : IXMLDocument;
+procedure LoadXMLDocument(
+ const fileName : string;
+ var doc : IXMLDocument
+);
//==================================================
const
//==================================================
// Constructor
-constructor IXMLNode.Create();
+constructor IXMLNode.Create;
begin
+ inherited;
+
FCount := 0;
end;
+// Destructor
+destructor IXMLNode.Destroy;
+var
+ i : Integer;
+begin
+
+ for i := FCount - 1 downto 0 do
+ FNodes[ i ].Free;
+ FChildNodes.Free;
+
+ inherited;
+
+end;
+
function IXMLNode.GetAttribute( const Name : string ) : string;
var
i : Integer;
end;
end;
-function LoadXMLDocument(
- const fileName : string
-) : IXMLDocument;
+procedure LoadXMLDocument(
+ const fileName : string;
+ var doc : IXMLDocument
+);
type
xmlMode = ( xmlHoge );
var
xmlFile : TFileStream;
- doc : IXMLDocument;
begin
-
- doc := IXMLDocument.Create;
+ //Result := IXMLDocument.Create;
+ //doc := IXMLDocument.Create;
xmlFile := TFileStream.Create( fileName, fmOpenRead );
- XMLReadNode( xmlFile, IXMLNode( doc ) );
- xmlFile.Free;
- Result := doc;
+ try
+ XMLReadNode( xmlFile, IXMLNode( doc ) );
+ //XMLReadNode( xmlFile, IXMLNode( Result ) );
+ finally
+ xmlFile.Free;
+ end;
+
+ //Result := doc;
end;
end.
-
\ No newline at end of file