Delphi Programming Tutorial #39 - XML Data Binding
Why Stack Overflow recommends it
Stack Overflow users link it when answering how to read or work with XML in Delphi, as a walkthrough of the XML Data Binding Wizard.
Recommended by 3 people across 3 different months, 2010 to 2013.
What it is
An 8-minute Delphi tutorial by Delphi MVP Alister Christie, part of his numbered LearnDelphi.tv series. It walks through the XML Data Binding Wizard and uses it to generate code for reading and manipulating an XML file.
What people said
Recommends SalvadorGomez · 2010-08 · Stack Overflow · on “Working with XML in Delphi (returning specific data to a variable)”
I think you could do somethig with this in the next lines: someNode := XMLDoc.selectSingleNode('//route/to/node'); str := someNode.text; The parameter for selectSingleNode is basicaly an XPath expression, so you can query attribute nodes like: //route/to/node/@attrib Here is the MSDN reference to selectSingleNode: [LINK] and here is the XPath sintax: [LINK] Also, I can point you to a good XML library for XML Manipulation from Delphi that is also compatible with MSXML but you don't have to use variants directly : [LINK] And a much better approach if your XML doesn't change much, is to use the XML Data Binding wizard, that basically creates a complete object model from a XML or XSD (it makes t
Recommends mjn · 2010-12 · Stack Overflow · on “XML file or database in this particular case (file updated frequently)”
I would also use a XML (or JSON) file storage. A simple way to build wrapper classes for a XML file is the XML Schema Binding Generator Wizard in Delphi Professional, or the Data Binding Wizard (in Enterprise / Architect). You only need to provide an example XML or a W3C XSD [LINK] file. The wizard will create DOM based classes and binding code. Tutorials: Delphi XML Binding Wizard Tutorial [LINK] Delphi Programming Tutorial #39 - XML Data Binding [this video]
Recommends Jeroen Wiert Pluimers · 2013-07 · Stack Overflow · on “How to read XML file in Delphi?”
Use the Delphi XML Data Binding Wizard [LINK] for this. It will generate a unit with Delphi wrapper objects around your XML file (or if you have it an XSD file describing the XML). Those wrappers are based on the IXMLDocument which is very similar to the IXMLDOMDocument you are using now, and add a layer around it that allows you to access your data with more support from the Delphi compiler usually making the process of handling the data inside the XML much easier than using plain IXMLDocument or IXMLDOMDocument . The unit contains methods to load the XML from either a file or a string. There is a good tutorial [LINK] and a nice video [this video] on using this wizard.
Cites Jeroen Wiert Pluimers · 2011-05 · Stack Overflow · on “XSD to Delphi Classes without XML binding”
Reading between the lines (please use less abbreviations, for instance, VS has multiple meanings [LINK] , even in computing), and You probably used the XSD.EXE [LINK] tool in Visual Studio or the .NET SDK to generate your source code in the C# or VB.NET language. If you have Delphi Prism [LINK] , you can use XSD.EXE to generate Delphi Prism source code [LINK] . The Delphi Prism language is very close to the Delphi native language, so that will give you a kick start. This should work with the Delphi Prism trial too. BTW: Why do you not want to use the Delphi native code generated by the XML Data Binding Wizard [this video] in a standalone way? It is interface based, but is pretty fast and works ve