Host_id='dataserver12 host_addr=' 172.16.10.12 module='
Pid='31366' version='1' & gt;
Host_id='dataserver12 host_addr=' 172.16.10.12 module='
Pid='31366' & gt;
Host_id='dataserver12 host_addr=' 172.16.10.12 module='
Pid='31366' & gt;
Host_id='dataserver12 host_addr=' 172.16.10.12 module='
Pid='31366' & gt;
Host_id='dataserver12 host_addr=' 172.16.10.12 module='
Pid='31366' & gt;
Host_id='dataserver12 host_addr=' 172.16.10.12 module='
Pid='31491' & gt;
Host_id='dataserver12 host_addr=' 172.16.10.12 module='
Pid='31507' & gt;
can read the value of the time and the label for & lt; Txt> The content is enough & lt;/txt>
Deposit to tb_alert (occur_time date, message varchar2 (200)),
Or is there any easier way to put the XML data display multiple lines,
A & lt; Msg> For a line, the content of
CodePudding user response:
Delphi using NatiiveXML third visit to the controls, parsing the one small case, search on the net, make one to get to know myself, don't wait for the code, it is better to own to fast,CodePudding user response:
Note: I use is the XMLDocument1 Delphi controls, first of all, the original poster to text and not standard XML document, so first processed into relatively ready to use it can parse XML,
Var
I: Integer;
Clist: TStringList;
The begin
Clist:=TStringList. Create;
Clist. LoadFromFile (' 1. XML);
XMLDocument1. XML. The Clear;
XMLDocument1. XML. Text:='& lt; ? The XML version="1.0" encoding="gb2312"?>'+ clist. Text + & lt;/ROOT> ';
XMLDocument1. Active:=true;
For I:=0 to XMLDocument1. DocumentElement..childnodes. Do the Count - 1
The begin
Memo1. Lines. The Add (
XMLDocument1. DocumentElement..childnodes [I] Attributes [] 'time' + '
+ XMLDocument1. DocumentElement..childnodes [I].childnodes [0]. The Text
);
The end;
Clist. Free;
The end;
CodePudding user response:
Wanted to help you parse the XML is not complete,Best you provide complete XML standard file,
CodePudding user response:
XML Data Binding + XMLDocument don't know can meet the needs of the building Lord?CodePudding user response:
Parses XML third-party controls a lot of ahCodePudding user response:
Simple parsing, the regular expression is more convenient,& lt; MSG time="(. *?) '[\ s \ s] *?(. *) \ r \ n & lt;/txt> \ r \ n
CodePudding user response: