Nativexml (1): Download, install, and test

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.