5,392
社区成员
发帖
与我相关
我的任务
分享
xmldoc := TXMLDocument.Create(nil);
//DocIntf := xmldoc;
try
//coinitialize(nil);
Stream := TResourceStream.create(HINSTANCE, 'isbn', 'xml');
try
xmldoc.LoadFromStream(Stream, xetUTF_8);
xmldoc.Active := True;
finally
Stream.Free;
//couninitialize;
end;
//判断 组号 <EAN.UCC> 目前978 979
nodeList := xmldoc.DocumentElement.childNodes[3].ChildNodes;
for i := 0 to nodeList.Count - 1 do
begin
//ShowMessage(nodeList[i].ChildNodes[0].NodeValue);
//ShowMessage(qz);
if zh<>'' then break;
if nodeList[i].ChildNodes[0].NodeValue = qz then
begin
nodeListN := nodeList[i].ChildNodes[2].ChildNodes;
//ShowMessage(IntToStr(nodeListN.count));
for j := 0 to nodeListN.count - 1 do
begin
Frang := nodeListN[j].ChildNodes[0].NodeValue;
//ShowMessage(Frang);
Fmin := StrToInt(copy(Frang, 1, pos('-', Frang) - 1));
Fmax := StrToInt(copy(Frang, pos('-', Frang) + 1, maxint));
if (Fzh >= Fmin) and (Fzh <= Fmax) then
begin
zh := copy(EANISBN, 4, strtoint(nodeListN[j].ChildNodes[1].NodeValue));
//ShowMessage(zh);
break;
end;
end;
end;
end;