TXMLDocumentSaveToStream (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following example uses the SaveToStream function.

Code

void Test_SaveToStream() {
	_di_IXMLDocument document;
	TFileStream *stream;
	_di_IXMLNode node;

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

	// Define document content.
	node = document->CreateNode("TestElement");
	document->DocumentElement = node;

	stream = new TFileStream(destPath, fmCreate);
	document->SaveToStream(stream);
	delete stream;
}

Uses