TXMLDocumentDOMVendor (C++)

From Appmethod Code Examples
Jump to: navigation, search

Description

The following example uses the DOMVendor property.

Code

void Test_DOMVendor() {
	TXMLDocument *document;
	TDOMVendor *vendor;

	document = new TXMLDocument(NULL);

	// Get document vendor.
	vendor = document->DOMVendor;
	if (vendor != 0) {
		printf("Document DOM vendor is  \"%ls\".\n", vendor->Description());
	}
	else {
		printf("Document has no DOM vendor.\n");
	}

	// Display registered DOM vendors with this application.
	const int numVendors = DOMVendors->Count();
	printf("Number of registered DOM vendors with this application is %d.\n",
		numVendors);
	for (int i = 0; i < numVendors; i++) {
		vendor = DOMVendors->Vendors[i];
		printf("\t%ls\n", vendor->Description());
	}

	// Find a specific registered DOM vendor.
	vendor = DOMVendors->Find("MSXML");
	if (vendor != 0) {
		// Set document DOM vendor.
		document->DOMVendor = vendor;
		printf("Document DOM vendor is \"%ls\".\n",
			document->DOMVendor->Description());
	}
	else {
		printf("Could not find DOM vendor.\n");
	}

	delete document;
}

Uses