TXMLDocumentParseOptions (C++)

From RAD Studio Code Examples
Jump to: navigation, search

Description

The following example uses the ParseOptions property.

Code

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

	// Set parse options.
	// This should be done before loading (and parsing) the document.
	document->ParseOptions = document->ParseOptions + (TParseOptions() << poPreserveWhiteSpace);

	// Uncomment the following line to strip white spaces.
	//document->ParseOptions = document->ParseOptions - (TParseOptions() << poPreserveWhiteSpace);

	const String s = "<CloudType>       <Cirrocumulus />       </CloudType>";
	document->LoadFromXML(s);

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

Uses