Delphi reads the XML is not difficult, to learn: http://peirenlei.iteye.com/blog/305030
CodePudding user response:
There is a call NativeXML control
CodePudding user response:
Worth learning!
CodePudding user response:
With Internet page inside the XMLDocument controls, baidu once there are many examples of specific usage Or direct interception of string
CodePudding user response:
For example, or demonstration
CodePudding user response:
I also want to know,
CodePudding user response:
Const S= '& lt; ? The XML version="1.0"?> ' + '& lt; The Document XMLNS: xsi="http://www.w3.org/2001/XMLSchema-instance" XMLNS: XSD="http://www.w3.org/2001" + '/XMLSchema "SN=" 300805 "License=" 1 "Version=" 2.2.1 "& gt; ' + '& lt; Events> ' + '& lt; The Event Name="SalesWareHouseOut MainAction"="WareHouseOut & gt;" ' + '& lt; DataField> ' + '& lt; The Data Code="88157960000084632422" CorpOrderID="0319781" the Actor="1" ActDate="2012-07-05 14:47:56"/& gt; ' + '& lt; The Data Code="88157960000061325274" CorpOrderID="0319781" the Actor="1" ActDate="2012-07-05 14:47:56"/& gt; ' + '& lt; The Data Code="88157960000060866605" CorpOrderID="0319781" the Actor="1" ActDate="2012-07-05 14:47:56"/& gt; ' + '& lt; The Data Code="88157960000091704302" CorpOrderID="0319781" the Actor="1" ActDate="2012-07-05 14:47:56"/& gt; ' + '& lt;/DataField> ' + '& lt;/Event> ' + '& lt;/Events> ' + '& lt;/Document> ';
The function GetXmldata (Source: string; Sl: TStringlist) : Boolean; Const head='& lt; The Data Code="'; Var I: integer; The begin Result:=false; I:=pos (head, Source); If i<1 then the exit; Repeat I:=I + length (the head); Sl. Append (copy (20) Source, I,); Delete (Source, 1, I); I:=pos (head, Source); Until i<1; Result:=true; end;
Procedure TForm1. Button1Click (Sender: TObject); Var sl: TStringlist; The begin Sl:=TStringlist. Create; Then the if GetXmldata (s, sl) Showmessage (sl) Text); Sl. Free; end;