Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-09-2017
cmfab cmfab is offline
Miembro
 
Registrado: jun 2010
Posts: 419
Poder: 14
cmfab Va por buen camino
Creando interface XML con XML DataBinding

Estimados, buenas tardes a todos !. a ver si alguien puede echarme una mano.

He creado una plantilla de un documento XML para después poder importarlo a un proyecto con el objetivo de crear los objetos y poder leerlo desde una aplicación cliente de un WebServices.

La estructura es sencilla:

Código Delphi [-]

      1
      "SERV1"
      "SERVICIO1"
      2
      "SERV2"
      "SERVICIO2"      

una vez que creo el documento uso la opción de delphi "XML DantaBinding" y lo que me está sucediendo es que los valores de alias y service_name me los toma como una colección o array de tipo de datos Integer al crear la interface.

Código Delphi [-]
{ IXMLServiceListType }

  IXMLServiceListType = interface(IXMLNode)
    ['{E1B6D7EE-7CE9-41A7-8CEE-6EC032EC845C}']
    { Property Accessors }
    function Get_Id_service: IXMLIntegerList;
    function Get_Alias: IXMLIntegerList;
    function Get_Name_service: IXMLIntegerList;
    { Methods & Properties }
    property Id_service: IXMLIntegerList read Get_Id_service;
    property Alias: IXMLIntegerList read Get_Alias;
    property Name_service: IXMLIntegerList read Get_Name_service;
  end;

{ IXMLIntegerList }

  IXMLIntegerList = interface(IXMLNodeCollection)
    ['{D12E15F7-DC94-4604-84FB-C50DD255BDA1}']
    { Methods & Properties }
    function Add(const Value: Integer): IXMLNode;
    function Insert(const Index: Integer; const Value: Integer): IXMLNode;

    function Get_Item(Index: Integer): Integer;
    property Items[Index: Integer]: Integer read Get_Item; default;
  end;

{ Forward Decls }

  TXMLServiceListType = class;
  TXMLIntegerList = class;

{ TXMLServiceListType }

  TXMLServiceListType = class(TXMLNode, IXMLServiceListType)
  private
    FId_service: IXMLIntegerList;
    FAlias: IXMLIntegerList;
    FName_service: IXMLIntegerList;
  protected
    { IXMLServiceListType }
    function Get_Id_service: IXMLIntegerList;
    function Get_Alias: IXMLIntegerList;
    function Get_Name_service: IXMLIntegerList;
  public
    procedure AfterConstruction; override;
  end;

{ TXMLIntegerList }

  TXMLIntegerList = class(TXMLNodeCollection, IXMLIntegerList)
  protected
    { IXMLIntegerList }
    function Add(const Value: Integer): IXMLNode;
    function Insert(const Index: Integer; const Value: Integer): IXMLNode;

    function Get_Item(Index: Integer): Integer;
  end;

Da igual si en el xml tengo las comillas o no, siempre me toma los tres campos como enteros. alguna idea ?. Gracias.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Uses en Interface e Implementation bumiga OOP 5 31-07-2012 10:32:58
¿lazarus puede importar archivos XSD hacer databinding? JXJ Lazarus, FreePascal, Kylix, etc. 0 17-08-2011 06:30:30
diseño de interface lookmydoom OOP 2 15-10-2006 09:13:55
colores de interface pablo Gráficos 2 07-03-2005 14:43:58
Interface Delphi 7 silviodp Varios 1 24-12-2004 00:44:10


La franja horaria es GMT +2. Ahora son las 16:04:34.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi