7

I need a sample or tutorial on working with XML files. I want to create a file that contains a "record" to a person, something like this:

Name: Just Me
Age: 99
EMail: me@some.net

I want to learn how to read and write an XML file.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
Remus Rigo
  • 1,454
  • 8
  • 34
  • 60

5 Answers5

9

See Creating, Parsing and Manipulating XML Documents with Delphi

bugmagnet
  • 7,631
  • 8
  • 69
  • 131
6

Have a look at Jeroen Pluimers Sessions at CodeRage 4

called Practical XML in Delphi

"Starting with the XML basics, learn about well formed and valid documents, encoding, and recoding and XSD validation. See examples in Delphi for Win32 and Delphi Prism showing you which tool to choose when. Finally, learn where things can go wrong and how to prevent that: improper but well formed XML, copying data between XML documents, convert XML to tables and objects, etc."

Charles Faiga
  • 11,665
  • 25
  • 102
  • 139
3

This can get you up to speed in less than 10 minutes: http://www.youtube.com/watch?v=4D78MG4CaAI (a tutorial on using XML data binding wizard)

Tihauan
  • 2,780
  • 2
  • 26
  • 29
  • Cool, someone has watched my video. I'm currently producing a commercial video on TXMLDocument (hopefully the first in a series on XML in Delphi). Also http://youtu.be/7b8jbuu-RAY might be of interest – Alister Sep 05 '12 at 09:17
  • @Alister you need to do more cardiac exercise, you breath as you can barely move. its very dis-focusing in your videos, i keep thinking you are about to die, and side track from your speech. – none Nov 13 '12 at 12:35
3

Wow, I just noticed this post after posting a tutorial of Xml serialization with Delphi 2010.

It can be looked at to see out TXmlDocument works, but there are many other methods that will work as well.

I typically use msXml unit directly as it exposes XPath which TXmlDocument does not.

Robert Love
  • 12,447
  • 2
  • 48
  • 80
3

I use this VCL component:

NativeXML

Edit:

NativeXml is currently open-sourced.

menjaraz
  • 7,551
  • 4
  • 41
  • 81
M Schenkel
  • 6,294
  • 12
  • 62
  • 107