TLama

Untitled

Sep 5th, 2013
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.76 KB | None | 0 0
  1. var
  2.   ...
  3.   OfficeNode: IXMLNode;
  4. begin
  5.   ...
  6.     // find the "despachos" subnode of the currently iterated "processo" node
  7.     OfficeNode := ProcessNodes[I].ChildNodes.FindNode('despachos');
  8.     // if there is "despachos" subnode, then...
  9.     if Assigned(OfficeNode) then
  10.     begin
  11.       // go yet one level deeper (I'm reusing the OfficeNode variable here)
  12.       OfficeNode := OfficeNode.ChildNodes.FindNode('despacho');
  13.       // if the "despacho" subnode was found in "despachos", then...
  14.       if Assigned(OfficeNode) then
  15.       begin
  16.         // get the "codigo" attribute value
  17.         AttribNode := OfficeNode.AttributeNodes.FindNode('codigo');
  18.         if Assigned(AttribNode) then
  19.           ShowMessage(AttribNode.Text);
  20.       end;
  21.     end;
  22.   ...
  23. end;
Advertisement
Add Comment
Please, Sign In to add comment