[ Download Code ]
Creating XML files with a text editor would be a lot easier if you didn’t have to close all those HTML tags. First you have to add the XML declaration and the root opening and closing HTML tags. Next, you start adding element opening and closing tags one at a time. Of course, once you have the initial sequence completed you can just copy and paste to repeat the required elements. After doing this hundreds of times you’ll be looking for a faster way to create XML files.
Some XML editors will automatically add the closing tag after you have finished typing the opening tag but, you still have to type the brackets around the opening tag. I kept thinking this process should be easier. So, I came up with a solution that allows you to create XML files without using HTML tags.
This console application will create an XML file based on user input. Just enter the file name, how many element fields you want, and the name of each field. Optionally, you can include a data type separated by a comma after the field name. You can just enter the field name because the data type is not required. The structure of the XML file that is created will be compatible with the .NET DataSet and can be easily added to a database.
The download includes both the source code and the already compiled application. You can start using the executable right away or customize it to meet your needs. All you will need is the .NET Framework and a text editor, like Notepad, to build this application.
The information that is usually found in the AsemblyInfo.cs file has been added to the XmlCreator.cs file so that everything needed to compile the application is in a single file.
[assembly: AssemblyDescription("Easily Create Xml Files")]
[assembly: AssemblyCompany("Andrew Mooney")]
[assembly: AssemblyCopyright("Copyright (c) 2004 by Andrew Mooney")]