Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Locating next TXMLDocument.XMLNode with same name

Status
Not open for further replies.

martinm

IS-IT--Management
Mar 30, 2001
113
GB
Hi - I'm using TXMLDocument (D6), and need to find all the nodes with a given name. The code below always returns the first (from the root) matching node, and as such never exits the loop. How can I start the search from the current position?

lndeTmp := lndeRoot.ChildNodes.FindNode('Param');
while assigned(lndeTmp) do
begin
with lndeTmp.ChildNodes.FindNode('ParamName') do
Showmessage(text);
lndeTmp := lndeRoot.ChildNodes.FindNode('Param');
end;


Cheers.
 

Var Param: String;

param := 'item';
getElementsByTagName(param);

that will go through the XML file and return all matching.

Kind Regards, Paul Benn

**** Never Giveup, keep trying, the answer is out there!!! ****
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top