You already know that you can create an XML document as an XML file using any text editor. However, it is often necessary to create an XML document or fragment dynamically in an application. For example, an application might need to output results in an XML format for downstream processing, or legacy data might need to be reformatted in XML.
In this project, we will show you how to create an XML document in memory. Specifically, we will demonstrate how to add processing instructions, comments, elements, and text nodes. We will also show how to use extra white space text nodes to provide a structured format when the DOM object is serialized.
This tutorial uses or creates the following files:
File | Description |
---|---|
Source: dynamDOM.frm | Visual Basic source code. |
Output | Output from the application. |
To create the DynamDOM Visual Basic Project
Next, we’ll add the source code for this project.