Last Updated on
What is XML for?
XML is intended to make it easy and straightforward to use SGML on the Web: easy to define document types, easy to author and manage SGML-defined documents, and easy to transmit and share them across the Web.
It defines an extremely simple dialect of SGML which is completely described in the XML Specification. The goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML.
For this reason, XML has been designed for ease of implementation, and for interchangeability with both SGML and HTML
XML is not just for Web pages: it can be used to store any kind of structured information, and to enclose or encapsulate information in order to pass it between different computing systems which would otherwise be unable to communicate. For example when you try and link a simple proxy with a web server which streams videos then XML can be particularly useful for formatting. For example designing a portal to allow access to watch BBC TV abroad you can use both SML and XML in it’s design structure.
1. XML requires your document is well-formed.
This means that you cannot create tags that overlap one another. While valid HTML has the same requirement, HTML does accept overlapping tags.
2. XML is case-sensitive.
If you start a tag in lowercase, you must close the tag in lower-case. For example, while the following is valid HTML, it is invalid XML: …. We choose to define our XML tags entirely in lower-case.
3. Empty tags must be specified as empty.
An empty tag is a tag that does not have a close tag (eg., ). For example, the IMG, INPUT, BR are empty tags. HTML knows they are empty tags because it is built-into the HTML engine. Since XML may contain arbitrary tags that may not be tested against a DTD (the description of the document) the tags must self-document whether they are containers or not. If you create an empty element in XML, you must provide a “/” at when the tag ends. You can use it to illustrate minimum requirements for example to highlight a UK proxy fast enough for streaming video.
4. All attribute values in XML must be specified in quotes.
HTML is fairly flexible in allowing you to omit quotes when specifying attribute values (eg.,
). In XML, always remember your quotes,.