What you must know about XML files

XML is a Markup Language, like HTML. But, differently from HTML, XML enforces very strict rules!

You may be used to write html code without pay attention to lowercase/uppercase differences, closing tags, escaping special character, etc. You can do this because all browsers try to couple with little errors in html pages so that everything works well. The XML files you provide to my slideshow are not parsed by your browser: a little syntactical error the XML file definitely compromise everything!!!*
Then your XML files MUST BE VALID, in a strict sense.

The good news is that several modern browsers (including IE and FireFox) can be used to test XML files. Simply open the file with your browser, if something is not correct it will reveal the error.

To edit and XML file should use a simple text editor (like notepad, TextEdit, vi). If you use other editor (like WYSIWYG HMTL editors) be sure that your editing the source code. I suggest you to cut and past fragments of code from this site into your file and then modify only those part that you need to change; don't write the xml file from scratch.

Special Characters

You cannot use the following characters:

  • <
  • >
  • &

You must use &lt;, &gt, and &amp; instead, even inside attribute values. So, for example, you cannot write

<photo href="script.php?id=10&name=abc">img1.jpg</photo>

you must write replace & with &amp;

<photo href="script.php?id=10&amp;name=abc">img1.jpg</photo>

See also:

Personal Tools