Cita:
Empezado por newtron
Gracias olbeup, ya he resuelto el tema usando TXMLDocument pero igual tu solución es más elegante. ¿Cómo funciona el objeto ese que has preparado?.
Saludos
|
Hola newtron,
Mas elegante no creo que sea, te pongo un ejemplo de la etiqueta del <GrpHdr>:
Código Delphi
[-]const
ISODateTime: string = 'yyyy-mm-dd"T"hh:nn:ss';
ISODate: string = 'yyyy-mm-dd';
ISOMsgId: string = '"PRE"yyyymmddhhnnss"%sRMS-%s"';
ISOUNIFI20022 = [32, 39..41, 65..90, 63, 97..122, 43..58];
ISOCHANGE20022: char = '.';
type
TGrpHdr = class;
TInitgPty = class;
TInitgPty_Id = class;
TInitgPty_Id_OrgId = class;
TInitgPty_Id_OrgId_Othr = class;
TCstmrDrctDbtInitn = class
private
FGrpHdr: TGrpHdr;
FPmtInf: TPmtInf;
FIDRemittance: Integer;
FIDBankSEPA: Integer;
FConnectionString: string;
protected
public
constructor Create(AConnectionString: string);
destructor Destroy; override;
function ExecuteConvertToXML: Boolean;
procedure SaveToFileXML(const FileName: string);
published
property GrpHdr: TGrpHdr read FGrpHdr write FGrpHdr;
property PmtInf: TPmtInf read FPmtInf write FPmtInf;
property ConnectionString: string read FConnectionString write FConnectionString;
property IDBankSEPA: Integer read FIDBankSEPA write FIDBankSEPA;
property IDRemittance: Integer read FIDRemittance write FIDRemittance;
end;
TGrpHdr = class
private
FMsgId: string;
FCreDtTm: TDateTime;
FNbOfTxs: Integer;
FCtrlSum: Double;
FInitgPty: TInitgPty;
function GetNbOfTxs: Integer;
function GetCtrlSum: Double;
function GetMsgId: string;
protected
FCstmrDrctDbtInitn: TCstmrDrctDbtInitn;
public
constructor Create(Owner: TCstmrDrctDbtInitn);
destructor Destroy; override;
function GetIXMLNode: IXMLNode;
published
property MsgId: string read GetMsgId;
property CreDtTm: TDateTime read FCreDtTm;
property NbOfTxs: Integer read GetNbOfTxs;
property CtrlSum: Double read GetCtrlSum;
property InitgPty: TInitgPty read FInitgPty write FInitgPty;
end;
Esto es una parte del desarrollo.
Un saludo.