//------------------------------------------------------------------------------ // Uint: 例子/XML处理者 //------------------------------------------------------------------------------ unit xmlhandler; interface uses System.SysUtils, System.IOUtils, System.Classes, FireHttp.Utils, FireHttp.Types, FireHttp.Classes, FireHttp.XML, FireHttp.Path, FireHttp.Log, FireHttp.Config; type example_xmlhandler = class(TXMLHandler) private const __PathInfo = '/xmlhandler'; const __Description = ''; protected procedure Execute; override; procedure Cleanup; override; public constructor Create(AThread: TWorkerThread); override; destructor Destroy; override; end; implementation { example_xmlhandler } procedure example_xmlhandler.Cleanup; begin inherited; end; constructor example_xmlhandler.Create(AThread: TWorkerThread); begin inherited Create(AThread); {$region '设置处理者'} MultiPathInfo.Add(__PathInfo); Description := __Description; {$endregion} end; destructor example_xmlhandler.Destroy; begin inherited; end; procedure example_xmlhandler.Execute; begin inherited; with Document.Root do begin AddNode('errorcode', '0'); AddNode('userid', '1'); AddNode('username', 'user1'); AddNode('password', '123456'); end; end; initialization RegisterHandlerClass(example_xmlhandler); end.