Ver Mensaje Individual
  #7  
Antiguo 25-01-2017
Avatar de AgustinOrtu
[AgustinOrtu] AgustinOrtu is offline
Miembro Premium
NULL
 
Registrado: ago 2013
Ubicación: Argentina
Posts: 1.858
Reputación: 15
AgustinOrtu Es un diamante en brutoAgustinOrtu Es un diamante en brutoAgustinOrtu Es un diamante en brutoAgustinOrtu Es un diamante en bruto
Por ejemplo, usando el XML que pusiste en el post de arriba, me genera esta interface:

Código Delphi [-]
  IXMLRifType = interface(IXMLNode)
    ['{4288BB28-3181-42AD-9F90-288F1CD5B4E5}']
    function GetNumeroRif: string;
    function GetNombre: string;
    function GetAgenteRetencionIVA: string;
    function GetContribuyenteIVA: string;
    function GetTasa: Integer;

    property NumeroRif: string read GetNumeroRif;
    property Nombre: string read GetNombre;
    property AgenteRetencionIVA: string read GetAgenteRetencionIVA;
    property ContribuyenteIVA: string read GetContribuyenteIVA;
    property Tasa: Integer read GetTasa;
  end;

Y tambien una clase que la implementa

Código Delphi [-]
  TXMLRifType = class(TXMLNode, IXMLRifType)
  protected
    function GetNumeroRif: string;
    function GetNombre: string;
    function GetAgenteRetencionIVA: string;
    function GetContribuyenteIVA: string;
    function GetTasa: Integer;
  end;

Luego tambien te da unas funciones globales que sirven para leer o inicializar las interfaces de arriba y poder trabajar con el XML

Código Delphi [-]
  function GetRif(const Doc: IXMLDocument): IXMLRifType;
  function LoadRif(const FileName: string): IXMLRifType;
  function NewRif: IXMLRifType;

Entonces podes escribir este tipo de codigo y te olvidas de tener que andar analizando nodo a nodo para encontrar la informacion:

Código Delphi [-]
var
  Xml: IXMLRifType;
begin
  Xml := LoadRif('RutaArchivo');
  ShowMessage(Xml.AgenteRetencionIVA);
  ShowMessage(Xml.NumeroRif);
end;
Responder Con Cita