Create XML Files without using HTML Tags
page 1 of 4
Published: 13 Jan 2005
Unedited - Community Contributed
Abstract
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.
by Andrew Mooney
Feedback
Average Rating: 
Views (Total / Last 10 Days): 32750/ 67

Introduction

[ 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.

In addition to creating the XML file, an XSL file and HTML file are also created. The HTML file uses client side JavaScript to transform the XML file using the XSL file. This provides an easy way to view the new XML file by displaying it in a table layout.

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.

using System.Reflection;
using System.Runtime.CompilerServices;
[assembly: AssemblyTitle("XmlCreator")]
[assembly: AssemblyDescription("Easily Create Xml Files")]
[assembly: AssemblyCompany("Andrew Mooney")]
[assembly: AssemblyProduct("XmlCreator")]
[assembly: AssemblyCopyright("Copyright (c) 2004 by Andrew Mooney")]
[assembly: AssemblyVersion("1.0.0.0")]


View Entire Article

User Comments

No comments posted yet.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-09-23 1:44:03 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search