Article ID: 251273
Article Last Modified on 4/29/2005
APPLIES TO
- Microsoft Visual C++ 6.0 Enterprise Edition
- Microsoft Visual C++ 6.0 Professional Edition
- Microsoft Visual C++ 6.0 Standard Edition
- Microsoft XML Core Services 4.0
- Microsoft XML Parser 2.5
- Microsoft XML Parser 2.6
- Microsoft XML Core Services 4.0
This article was previously published under Q251273
SUMMARY
NewXMLDOC.exe is a Visual C++ sample that shows you how to create a new XMLDOM document from scratch when you use #import on Msxml.dll.
MORE INFORMATION
The following file is available for download from the Microsoft Download Center:
Release Date: July 12, 2000
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. NewXMLDOC.exe contains the files listed in the following table.
FileName | Size |
---|---|
CreateXMLDOMDocument.cpp | 4.71KB |
CreateXMLDOMDocument.dsp | 4.40KB |
CreateXMLDOMDocument.dsw | 565B |
Notes
The sample shows how to create a simple XML document with the following structure:
<Customers> <customer id=345> <name FirstName="Jane" LastName="Doe"/> <orders> <order Date=07/16/98 ProductName="Visual Basic" /> <order Date=07/23/98 ProductName="Visual C++" /> </orders> </customer> </Customers>
- Inside the sample, the majority of the work is accomplished within the BuildTree() function. Notice that the sample also contains the following two structures that are defined to facilitate the building of the tree:
- XMLDocTreeBuilderInstrEnum: An enumeration that describes the node type.
- XMLDocSourceData: The actual data used to create the node. The BuildTree() function accepts an array of the XMLDocSourceData datatypes and uses this array to build XMLDOMDocument.
- Inline comments are available on major steps.
- On Windows NT 4.0 platform, if you download the NT 5.0 header files for XML samples and you get the following compiler errors: You need to alter the order of the new Windows 2000 header directories to the end of the search path.
The code sample uses #import on msxml.dll, which is for the MSXML 2.5 parser. If you have the MSXML 2.6 or MSXML 3.0 parser installed on the system, comment out the following code block:
#import "msxml.dll" using namespace MSXML; and add following correspondingly: #import "msxml2.dll" //msxml 2.6 parser using namespace MSXML2; or #import "msxml3.dll" //msxml 3.0 parser using namespace MSXML2; or #import "msxml4.dll" //msxml 4.0 parser using namespace MSXML2;
Keywords: kbhowto kbinfo kbdownload kbgraphxlinkcritical kbfile kbsample KB251273