TXMLDocument xml declaration (C++)

From Appmethod Code Examples
Jump to: navigation, search

Description

The following example uses these properties: Version, Encoding, and StandAlone.

Code

void Test_Declaration() {
	_di_IXMLDocument document = interface_cast<Xmlintf::IXMLDocument>
		(new TXMLDocument(NULL));

	const String s = "<?xml version=\"1.0\" encoding=\"UTF-16\" \
	standalone=\"yes\"?><TestElement>Inner text</TestElement>";
	document->LoadFromXML(s);

	// Display document version, encoding and stand-alone properties.
	printf("Version: %ls\n", document->Version);
	printf("Encoding: %ls\n", document->Encoding);
	printf("StandAlone: %ls\n", document->StandAlone);
}

Uses