Xml.XMLDoc.TXMLDocument.DocumentElement

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property DocumentElement: IXMLNode read GetDocumentElement write SetDocumentElement;

C++

__property Xml::Xmlintf::_di_IXMLNode DocumentElement = {read=GetDocumentElement, write=SetDocumentElement};

Properties

Type Visibility Source Unit Parent
property public
Xml.XMLDoc.pas
Xml.XMLDoc.hpp
Xml.XMLDoc TXMLDocument

Description

Provides access to the root node of the XML document.

Use DocumentElement to access the root node of the XML document. Because XML documents are hierarchical in structure, DocumentElement is the entry point to all data in the XML document. Setting DocumentElement replaces the entire data hierarchy with a new hierarchy of nodes.

Note: For some DOM implementations, if you set DocumentElement, all of the new nodes must already be associated with this document. That is, the new value should be a node that came from the existing node hierarchy or that was created using the CreateNode method.

The IXMLNode interface includes properties and methods for examining and changing the text and attributes of a node, for adding and deleting child nodes, and for traversing the hierarchy of nodes rooted at that node.

Note: DocumentElement is not available unless the XML document is Active.

See Also


Code Examples