J2EEOnlineJ2EE





XML Programming  «Prev  Next»
Lesson 6The goals of XML
Objective Brief explanation for each of the goals.

Goals of XML

Question: Why is the goal important; what does this mean for developer to provide some context.
After each goal, I find myself asking Why?
XML was created with specific design goals intended to make XML portable and simple to use.

The XML Recommendation delineates the following 10 goals:
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.


  6. 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.
  7. The XML design should be prepared quickly.
    It is better to spend time building the data than it is on building an XML design.
  8. 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.
  9. 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++.
  10. 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.