Web Development Tutorials


XML Editing

XML documents are not designed for human readability. Their purpose is for electronic creation, processing, storage, and exchange. Still, they are text documents that can be created and reviewed with text editing programs just like any other text document. The problem for people, though, is that XML documents surround their data with tags that get in the way of the information they contain. It is a chore to pick out the data of interest; it is even more trouble to create XML documents by hand, which is not an unreasonable thing to do with small data sets.

There are numerous XML editors that have been created to work with XML data. Some of these are elaborate software development environments designed for the professional programmer and data designer. Others are simple editors to ease the task of reading and writing XML files. In this latter category is Microsoft's XML Notepad, a free download that is also available through the link: XML Notepad. This download is a self-extracting installation file.

The following screen shot shows the open XML Notepad editor with an XML document displayed. The left window shows the structure of elements making up the document; the right window shows the data values associated with these elements.

XML Notepad

Figure 1-3.

XML Notepad.

It is very easy to create a document structure by adding and associating elements in the left window. Once a "record" structure is created it can be duplicated for as many data records as required. In the right window data values can be entered or edited.

The document is saved in XML format. Element names assigned to the data structure are converted to XML tags with their enclosed data values. The following screen shot shows the "source" view of the document.

XML Notepad

Figure 1-4.

XML Notepad source.

Notice that the document is validated as a "well formed" set of XML elements. It is not yet a "valid" XML document since it needs a prolog added to it.

You can certainly use any means you prefer to create XML documents, including using Notepad. However, an XML editor saves you the chore of typing XML tags, and it presents cleaner views of the information.

TOP | NEXT: Chapter 2 - Document Type Definitions