home *** CD-ROM | disk | FTP | other *** search
- unit usXMLParser;
-
- interface
-
- uses
- Classes;
-
- type
- TusXMLElement = class;
- TusXMLAttribute = class;
- TusXMLAttributes = class;
-
- TusXMLAttribute = class
- private
- FName: string;
- FValue: string;
- public
- property Name: string read FName write FName;
- property Value: string read FValue write FValue;
- end;
-
- TusXMLAttributes = class(TPersistent)
- private
- FList: TList; { List of TusXMLAttribute instances }
- protected
- function GetAttribute(aIndex: Integer): TusXMLAttribute;
- function GetCount: Integer;
- public
- constructor Create;
- destructor Destroy; override;
- procedure Add(aItem: TusXMLAttribute);
- procedure Assign(aSource: TPersistent); override;
- function AttributeByName(aName: string): TusXMLAttribute;
- procedure Clear;
- function Value(aName: string): string;
- property Count: Integer read GetCount;
- property Items[aIndex: Integer]: TusXMLAttribute read GetAttribute; default;
- end;
-
- TusXMLElement = class
- private
- FAttributes: TusXMLAttributes;
- FData: string;
- FTagName: string;
- FParent: TusXMLElement;
- public
- property Attributes: TusXMLAttributes read FAttributes;
- property Data: string read FData write FData;
- property TagName: string read FTagName write FTagName;
- property Parent: TusXMLElement read FParent;
- end;
-
- TusXMLDocument = class
- public
- property Count: Integer;
- property Items[aIndex: Integer]: TusXMLElement;
- end;
-
- implementation
-
- end.
-