You are here:About>Computing & Technology>Delphi Programming> Advanced Delphi Techniques> Delphi Does XML: Creating, Parsing and Manipulating XML Documents with Delphi
About.comDelphi Programming
Newsletters & RSSEmail to a friendSubmit to Digg
About Delphi Programming

RSS Feed

Creating, Parsing and Manipulating XML Documents with Delphi

From Zarko Gajic,
Your Guide to Delphi Programming.
FREE Newsletter. Sign Up Now!

Delphi and the Extensible Markup Language

What is XML?

XML is the 'Extensible Markup Language', universal language for data on the Web. XML gives developers the power to deliver structured data from a wide variety of applications to the desktop for local computation and presentation. XML is also an ideal format for server-to-server transfer of structured data. Using an XML parser, software is able to walk through the hierarchy of the document extracting the structure of the document, its content, or both. XML is in no way limited to Internet use. In fact, XML's main strength - organizing information - makes it perfect for exchanging data between different systems.

XML looks much like HTML. However, whereas HTML describes the layout of a page (for data displaying purposes) XML is concerned with defining and describing data, it describes the type of content. Hence, 'extensible' because it is not a fixed format like HTML.

We can also think of each XML file as a mini database. Tag, or markups (the text surrounded by angle brackets) in an XML document delineate the records and fields. The text between the tags is the data. We perform operations like retrieving, updating, and inserting data with XML using a parser and a set of objects exposed by the parser.

As a Delphi programmer, what you need to know is how to use XML. Therefore, in this article I'll be presenting several ways in which XML can be integrated into your Delphi applications.

Doing XML with Delphi

Delphi provides a wrapper component designed to read, create and parse XML documents: TXMLDocument.

Here's a list of XML related articles and tips:

Exporting TreeView to XML. Constructing a TreeView from XML
Here's how to store TTreeView component items to XML (preserving the Text and other properties of a tree node) and how to populate a TreeView from an XML file.

Simple Reading and manipulating RSS feeds files with Delphi
Learn how to read and manipulate XML documents with Delphi using the TXMLDocument component. Let's see how to extract the most current "In The Spotlight" blog entries (RSS feed) from the About Delphi Programming (this site).

Database table to XML and back
Creating XML files from Paradox (or any DB) tables using Delphi. See how to export the data from a table to a XML file and how to import that data back to the table.

How to create, use and free TXMLDocument dynamically (without an AV)
Delphi tip: If you need to work with dynamically created TXMLDocument component, you might be getting access violations once you try to Free the object. Here's what to do ...

How to Create the !DocType and ?XML Elements using TXmlDocument
Delphi's implementation of the TXMLDocument component, which basically uses Microsoft XML parser by default, does not provide a way to add a node of the "ntDocType" (TNodeType type). Here's how to solve this problem.

Basic XML Parsing in Delphi
This paper explains how to get started parsing simple XML files in Delphi using a DOM (Document Object Model) parser.

Intermediate Level XML Parsing with Delphi
How to parse XML files of arbitrary complexity and display them in a Delphi TTreeView component

Dynamically Creating an XML Document in Delphi
This article covers creating an XML document using the DOM object model. The code in this text is based on the Open XML components for parsing XML.

Creating and Traversing XML Documents
How to iterate through an XML document.

XML Topic Maps
Find out how XML topic maps provide a mechanism to intelligently classify information, and learn about the details you need to implement topic maps in your own Delphi applications.

Extracting XML Data From SQL Server 2000
XML and databases belong together, but isn’t it a pain to convert database output into XML yourself? Apparently not.

Use ADO.NET Datasets in Delphi
If you've experimented with Web Services, you might have hit some Microsoft .NET based Web Services which return data all right, but it's in the default XML format from ADO.NET. So you end up with some XML but you have no clue what to do with it! This article explains how you can take this XML, make sense out of it and even display it in a DB Grid.

Using XML And XSLT In Delphi
Introducing XML and how to use XML and XSLT within our Delphi apps to transform documents (such as HTML report files or websites) into other formats on demand.

XML Topics - not Delphi related

XML @ W3C
XML standard and syntax at the W3C site

XML.com
Where the general XML community shares resources and solutions, features timely news, opinions, features, and tutorials.

 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.