This documentation is archived and is not being maintained.

Creating New XML Files

Visual Studio .NET 2003

Because XML is an applicable format for so many different applications, there is no one specific reason why someone would create a new XML document. If you need to create an XML file from scratch, there are a couple of XML Designer specifics to take into account.

  • There are some instances of XML documents where Data view is disabled. This occurs when the XML source cannot be logically interpreted into structured data. If your XML document is structured in this way, changing to Data view will present a message stating, "Although this XML document is well formed, it contains structure that Data view cannot display."
  • When creating new XML documents, you always begin in XML view, working with XML source code. After you have added the initial tags and content, if your XML document can be interpreted into structured data, you can then change to Data view and use the data grid to add data to your XML file.

To create an XML file in Visual Studio

  1. From the Project menu, select Add New Item.
  2. In the Add New Item dialog box, select XML File.
  3. Type a name for your XML file.

    Visual Studio adds a new, blank XML file (.xml) to the project, automatically loads it into the XML Designer, and presents it in XML view.

  4. Add XML content to your file.

Next Steps

After you have created your XML file, you may want to:

See Also

XML Files | Assigning Schemas to XML Files | Checking for Well-Formed and Valid XML | Creating XML Schemas from XML Files | Relational Data in XML Schemas | Creating XML Schemas and Datasets