TXMLDocumentCreateNode (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following example uses the CreateNode function.

Code

void Test_CreateNode() {
	_di_IXMLDocument document;
	_di_IXMLNode node;

	document = interface_cast<Xmlintf::IXMLDocument>(new TXMLDocument(NULL));
	document->Active = true;

	node = document->CreateElement("TestElement", "");
	document->DocumentElement = node;
	node->ChildNodes->Add(document->CreateNode("TestComment", ntComment));

	// Display document content.
	printf("%ls\n", document->XML->Text);
}

Uses