RE:Otro problemilla con lo mismo
Hola vaya tarea esta de leer los XML me estoy rallando de una manera, tengo unas ganas de terminar y acabo de empezar como quien dice.
mi problema ahora es que solo quiero leer una parte se que cuando llega a la etiqueta TYPICAL_CYCLE_CHANNEL deje de llere el fichero yo lo estoy intentando hacer con un exit cuando lo lee pero no me hace caso.
procedure TForm1.ExtraeDatos(XmlNode: IXMLNode; depth: Integer);
var i: Integer;
Attr: IXMLNode;
begin
Edit1.Text := '';
edit2.Text := '';
Edit3.Text := '';
if XMLNode.NodeType = ntElement then
begin
if XmlNode.IsTextElement then
if XmlNode.NodeValue <> null then
Edit1.Text := XmlNode.NodeName + ' = ' + XmlNode.NodeValue
else
Edit1.Text := XmlNode.NodeName
else
if Pos ('AUTOMATIC_INTERPRETATION', XmlNode.NodeName) >0 then showmessage('ESTA');
if XmlNode.HasChildNodes then
Edit2.Text := XmlNode.NodeName;
for i:=0 to Pred(XmlNode.AttributeNodes.Count) do
begin
Attr := XmlNode.AttributeNodes[i];
if Attr.Text='' then Attr.NodeValue := ' ';
Edit2.Text := Attr.NodeName;
Edit3.Text := Attr.NodeValue ;
if (Attr.Text = 'Anormal') and (Pos ('AUTOMATIC_INTERPRETATION', XmlNode.ParentNode.NodeName)>0) then showmessage(' ESTA ANOR');
if (Pos ('TYPICAL_CYCLE_CHANNEL', XmlNode.NodeName)>0) then
begin
showmessage(XmlNode.NodeName);
Exit; //Aqui quiero que se deje de ejecutar la función pero no lo hace
end;
end;
if XmlNode.HasChildNodes then
for i:=0 to Pred(XmlNode.ChildNodes.Count) do
ExtraeDatos(XmlNode.ChildNodes[i], depth+1)
end;
end;
Muchas gracias