TXMLDocumentDOMDocument (C++)

From Appmethod Code Examples
Jump to: navigation, search

Description

The following example uses the DOMDocument property.

Code

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

	// Create document element through the DOM interface.
	_di_IDOMDocument domDocument = document->DOMDocument;
	_di_IDOMElement domElement;
	const HRESULT createResult = domDocument->createElement("TestElement",
		domElement);
	domDocument->documentElement = domElement;

	printf("%ls\n", domDocument->documentElement->nodeName);
}

Uses