节点如下: <?xml version="1.0" encoding="utf-8" ?>
- <Na>
|- <M1>
|- <M1>
|- <M1>
|- <M1>
我的语句如下,但是删除不了M1
//建立数据库XML文件
xmlDoc := TXMLDocument.Create(Application);
try
xmlDoc.LoadFromFile(AppPath + 'ms1.xml');
xmlDoc.Active := True;
xmlDoc.Version := '1.0';
xmlDoc.Encoding := 'utf-8';
TopNode := xmlDoc.DocumentElement; //Navigation
Node1 := TopNode.ChildNodes.First;
while Node1 <> nil do
begin
if Node1.NodeName = 'M1' then TopNode.ChildNodes.Delete('M1');
Node1 := Node1.NextSibling;
end;
finally
xmlDoc.Free;
end;
- <Na>
|- <M1>
|- <M1>
|- <M1>
|- <M1>
我的语句如下,但是删除不了M1
//建立数据库XML文件
xmlDoc := TXMLDocument.Create(Application);
try
xmlDoc.LoadFromFile(AppPath + 'ms1.xml');
xmlDoc.Active := True;
xmlDoc.Version := '1.0';
xmlDoc.Encoding := 'utf-8';
TopNode := xmlDoc.DocumentElement; //Navigation
Node1 := TopNode.ChildNodes.First;
while Node1 <> nil do
begin
if Node1.NodeName = 'M1' then TopNode.ChildNodes.Delete('M1');
Node1 := Node1.NextSibling;
end;
finally
xmlDoc.Free;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货