1. Home
  2. Computing & Technology
  3. Delphi Programming
Zarko Gajic
Zarko's Delphi Programming Blog

By Zarko Gajic, About.com Guide to Delphi Programming

How to Create the "!DocType" and "?XML" Elements using TXmlDocument

Friday September 18, 2009

XML :: Delphi's TXmlDocument component can be used to either read (and process) an existing XML document or to construct a new, empty XML document.

Unfortunately, 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).

Read the full article for a Neat trick to add !DocType and ?XML to the TXmlDocument

Related: Exporting a TreeView to XML. Populating a TreeView from XML | Work with dynamically created TXMLDocument | Reading and Manipulating XML files (RSS feeds) with Delphi

Comments

September 18, 2009 at 9:28 am
(1) Alex Artsikhovsky says:

Well… article is confusing… not to say funny.

Even if the name is “How to Create the “!DocType” and “?XML” Elements using TXmlDocument”, in article this achieved using TStringList.
So what TXMLDocument has to do with it?

September 18, 2009 at 1:00 pm
(2) Zarko Gajic says:

@Alex: Well when you need to create XML you *would* use TXMLDocument – not TStringList. But if you need to add ““!DocType” or ““?XML” to that XML, you can do it if you cheat using TStringList. Therefore TXMLDocument to create XML, TStringList to add non supported nodes.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.