The XML Recommendation delineates the following 10 goals:
- XML shall be straightforwardly usable over the Internet.
When you write XML it should be readily available over the Internet. XML is not intended as a programming language for stand-alone systems, but rather to be used across the Internet as a means of information interchange.
- XML shall support a wide variety of applications.
The beauty of XML is that it was intended to be used for as many things as possible.
This flexibility can sometimes make it more difficult to understand and ultimately, XML can be used to describe a Web page about object technology or a database of integrated circuits.
- XML shall be compatible with SGML.
SGML or Standard Generalized Markup Language, is the ISO standard on which all XML, hence XHTML documents are based upon.
If a document is not compatible with SGML, then it cannot be called XML.
- It shall be easy to write programs that process XML documents.
XML was always intended to be easy to use and process and since
XML is based on human-readable text, this makes it a lot easier for developers to figure out what is meant by the XML tags.
This in turn makes it easier to write a program that processes those tags.
- The number of optional features in XML is to be kept to the absolute minimum, ideally zero.
Ideally, there would be zero optional features.
Optional features cause problems because they are not guaranteed to be present for a given situation.
The more optional features there are in a system the more combinations there are for the system and so the more difficult the programming becomes.
XML documents should be human-legible and reasonably clear.
Rather than having elements that are named 3157d you would have an element named
< first_name>. (The xml document can be written in such a way so that it is self-describing.)
Someone reading your XML should be able to determine what the data is describing.
The XML design should be prepared quickly.
It is better to spend time building the data than it is on building an XML design.
The design of XML shall be formal and concise.
Only include as many elements as you need to be clear and additional extraneous information should be avoided.
XML documents shall be easy to create.
XML is intended to not require a special editor or tool to create. And in fact, most XML documents can be edited in a text editor like Notepad++.
Terseness in XML markup is of minimal importance.
When you are creating XML element names,
first_name is better than fname because it is
clearer and more human readable. While you do want to keep element names short, the shortness should not be at the sacrifice of human-readability.
The next lesson describes approaches to using XML.