Basic XML Introduction Tutorial: Step 1 2 3 4


Checking your first xml file

You should now have a file with some name, such as "text-n01", and the extension "xml": i.e., "text-n01.xml" should be somewhere in your filespace or on a floppy disk or wherever you are keeping your files.

In order to see if it is really XML, the first step is to load it into not a text editor, which does not care what you load as long as it is some collection of characters, but into an XML editor, which is going to insist that whatever you load is at least syntactically well-formed XML.

A very simple XML editor: the Microsoft Xml notepad

Whereas later on in the course we will be using a somewhat simplified version of the professional state of the art tool for editing XML, Altova's XMLSpy, we will start with something much simpler: Microsoft's XML Notepad. You can start this on the computers in the FB10 CIP lab by looking under Programm-Werkzeuge. If you are working away from the CIP lab you can also download this program directly here.

Starting the program should bring up a window that looks as follows:

Try to load the file that you made in the previous step into this program by clicking in the File menu on Open in the usual way.

It is here that the problems might start!! ...

Does the file load without problems?

If your file loads without problems into the XML Notepad, then you have done very well! It is generally very difficult to create XML by hand as there are just too many "<" and ">" and getting these also all to match up properly takes a lot of care.

This is why we use an XML editor, as such editors can make sure that we do not make basic mistakes to begin with.

If the XML Notepad is happy with your file, then it will be showing you something like the following window and you can proceed with the last step of the tutorial. If not, you can proceed to the next step, where we examine what can have gone wrong.


You can click on the 'folder' like elements on the lefthand side of this window in order to expand or close elements. You will see that gives you exactly the structure of the file that you have made. Expanding some of the elements gives you views such as the following:

Notation

The XML structure on the left of the XML window shows XML elements that themselves have elements within them as folders. Elements that contain only text, such as <vb>are</vb> are shown simply as the oblique red icons. You should be able to follow things back from your file to see exactly how the structure of your file is being shown.

Note that you can get a very similar view by loading the file into a web browser. An example of how this looks is given here.

Next step Finding out where problems in the XML may be...