Ver Mensaje Individual
  #1  
Antiguo 17-08-2012
webmasterplc webmasterplc is offline
Miembro
 
Registrado: mar 2008
Posts: 275
Reputación: 17
webmasterplc Va por buen camino
Manipular Contenido XML

Buenas, estoy tratando de manipular un contenido de una respueta xml de un webservice, estoy usando los componentes nativexml alli me dan un ejemplo de manipular un archivo xml, pero yo tengo el contenido en una variable string y no se como podria manipularlos aca le dejo el codigo

Código Delphi [-]
var
  i, j: Integer;
  AXmlDocument: TNativeXml;
  resultado:string;
begin
  resultado:=edt1.Text;
txt1.Lines.Clear;
  AXmlDocument := TNativeXml.Create;
  try
    AXmlDocument.OnNodeLoaded:resultado;
    if assigned(AXmlDocument.Root) then with AXmlDocument.Root do
      for i := 0 to NodeCount - 1 do begin
        txt1.Lines.Add(Nodes[i].Name);
        for j := 0 to Nodes[i].NodeCount - 1 do
          txt1.Lines.Add(' ' + Nodes[i].Nodes[j].Name);
      end;
  finally
    AXmlDocument.Free;
  end;
Responder Con Cita