When I first heard about XML, I thought it was something similar to HTML. Needless to say, I was wrong. XML and HTML were designed with different goals. XML was designed to describe data and HTML was designed to display data. In this article we will try to learn some basics about XML. Then we will learn about DTD and XML schemas.
XML stands for eXtensible Markup Language. XML is used to aid the exchange of data. The language makes it possible to define data in a structured way. XML tags are not predefined like HTML. XML lets you create your own unique tags that are meaningful for your data, hence the use of the term "extensible."
An XML document does not do anything by itself. It is just pure information wrapped in tags. You have to write a piece of software to send, receive or display it. XML is recommended by the World Wide Web Consortium (W3C).
Using XML, data can be exchanged between incompatible systems. One of the biggest challenges for developers has been to exchange data between different systems over the Internet. By converting the data to XML, developers can greatly reduce this complexity and create data that can be understood by different types of applications.
XML is a meta-language. A meta-language is a language that's used to define other languages. You can use XML, for instance, to define a language like WML. XML is also used in SOAP and WSDL. XML has become popular to use with web services.
Above is an example of an XML document. The first line of this document is the processing instruction which indicates it is an XML document. This XML declaration also defines the XML version. In this case the document conforms to the 1.0 specification of XML.
An XML document must have a root element. Here <bookstore> is the root element. In the above XML example, <book> is a tag and has 4 child elements – title, author, year and price. The <title> tag has an attribute named "id." Attributes are name-value pairs.