Finally, you can squeeze out some time to learn Delphi.
Objective: To Learn nativexml:
1. You will be ready to use XML later.
2. Learn the memory processing mechanism.
3. Learn more about XML.
I just downloaded the latest nativexml328 and found it was just updated three days ago. Related address:
Http://www.simdesign.nl/xml.html
Http://www.simdesign.nl/forum/viewforum.php? F = 2
Nativexml328
Installation:
Copy the four files under general and the three files under nativexml, and then specify the path through tools> Options> Delphi Options> library path.
Maybe the author's intention is not so, but this is very simple.
In addition, I copied the test file under demo \ xml_test_files to c: \ temp \ to facilitate the test.
Test:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls; Type tform1 = Class (tform) memo1: tmemo; button1: tbutton; button2: tbutton; button3: tbutton; Procedure submit (Sender: tobject ); end; var form1: tform1; impl Ementation {$ R *. DFM} uses nativexml ;//! Const xmlfile = 'C: \ temp \ xml_test_files \ basic. xml'; // test file {open as is} procedure tform1.formcreate (Sender: tobject); begin memo1.lines. loadfromfile (xmlfile); end; {open with nativexml} procedure tform1.button1click (Sender: tobject); var XML: tnativexml; begin XML: = tnativexml. create (NiL); XML. loadfromfile (xmlfile); memo1.text: = xml. writetostring; XML. free; end; {use indent} procedure tform1.button2click (Sender: tobject); var XML: tnativexml; begin XML: = tnativexml. create (NiL); XML. loadfromfile (xmlfile); XML. xmlformat: = xfreadable; // format enumeration: xfcompact (compression), xfreadable (indent), xfpreserve (as if not processed) memo1.text: = xml. writetostring; XML. free; end; {specify indent text} procedure tform1.button3click (Sender: tobject); var XML: tnativexml; begin XML: = tnativexml. create (NiL); XML. loadfromfile (xmlfile); XML. indentstring: = ''; // The default value of the indentstring attribute is #9 XML. xmlformat: = xfreadable; memo1.text: = xml. writetostring; XML. free; end.