miswhe.blogg.se

Delphi xml iterate nodes
Delphi xml iterate nodes





delphi xml iterate nodes

StockHoldings would have two child nodes, which correspond to the two Stock tags. TXMLDocument would generate a hierarchy of nodes as follows: The root of the hierarchy would be the StockHoldings node. Each node corresponds to a tagged element in the document. Once an XML document has been parsed by a DOM implementation, the data it represents is available as a hierarchy of nodes.

delphi xml iterate nodes

The root node of this hierarchy is available as the DocumentElement property. Once you have an active TXMLDocument object, you can traverse the hierarchy of its nodes, reading or setting their values. You can specify the XML document as a string instead by using the XML property.If the XML document is stored in a file, set the FileName property to the name of that file.4 If you are working with an existing XML document, specify the document:

delphi xml iterate nodes

For information on DOM implementations, see "Using the Document Object Model" on page 37-2.ģ Depending on your implementation, you may want to set the ParseOptions property to configure how the underlying DOM implementation parses the XML document. The Object Inspector lists all the currently registered DOM vendors. TXMLDocument appears on the Internet page of the Component palette.Ģ Set the DOMVendor property to specify the DOM implementation you want the component to use for parsing and editing an XML document. The following steps describe how to use TXMLDocument to work directly with an XML document:ġ Add a TXMLDocument component to your form or data module. The starting point for working with an XML document is the TXMLDocument component. These simplify the process of loading, editing, and saving XML documents. The VCL (or CLX) defines a number of classes and interfaces for working with XML documents.







Delphi xml iterate nodes