eXtensible Markup Language: A Tutorial
暂无分享,去创建一个
SGML (Standard Generalized Markup Language) is mother of all the markup languages. eXtensible Markup Language (XML) is a derivative of SGML. In the Internet arena Hypertext Markup Language (HTML) is found to be unsuitable particularly when it comes to attach semantics to the data. That is why XML was developed. XML is still not a completely matured technology and more and more specifications are coming up. Currently XML version 1.0 is released by W3C. This paper is written to give an overview about the designing of a XML based solution for library science professionals. Paper: O Aditya Tripathi “If you use the original World Wide Web program, you never see a URL or have to deal with HTML. You're presented with the raw information. You then input more information. So you are linking information to information--like using a word processor. That was a surprise to me --that people were prepared to painstakingly write HTML.” --Tim Berners-Lee Tim Berners-Lee had vision about the easy access to the data all round the world, when he first proposed about the WWW. Since then Internet has gone a long way, from text-based browser to the present completely GUI (Graphical User Interface) browser. The representation of information has also changed. We saw the development of HTML in 1980s and then its various versions in 1990s, then came the era of XML (Extensible Markup Language). This change also supports the vision of Lee though he would have never dreamt about the development of such system for the web content development. But finally it was he who had the vision about the use of semantic Internet because there is lot of information available over Internet & finding information has become as difficult as finding gold coin in a garbage heap. That is why the domain specific information interchange systems are thought of and it is there XML comes into picture. 1. FROM SGML TO XML The markup languages that carry the instruction for text processing are known as ‘Procedural Markup’. The idea of markup was to format a particular kind of document. But later on it was felt that markup languages can be used for system to system information interchange also. This was first realized by Charles Goldfarb, Ed Mosher and Ray Lorie when they were working with legal documents. They designed the first markup language known as GML (Generalized Markup Language) based on the following observation: O The document processing programs needed to support a common document format. O The common format needed to be specific to their domain for example legal documents. O To achieve a high a degree of reliability, the document format would have to follow specific rules. For example, take an example of memorandum, To: Bishwanath Dutta CC: Bibhuti Bhushan Sahoo From: Aditya Tripathi Date: 27.01,2003 Subject: Appointment order -----------------------------------------------------------------------------------------------------------We are extremely happy to inform you that you are selected as the coordinator of Knowledge management team. If we look into this document we find that there are six fields in this document. O Who the document is intended for (the To: field) O Who has been sent a copy of document (the CC: field) O Who sent the document (the From: field) O The date of document written (the Date: field) O The subject of document (the Subject: field) O The document body eXtemsible Markup Language: A Tutorial Paper: O So, if we make a fixed structure of this document then whoever writes the document has to write it in the same structure. Thus if we try to port the information from one system to another it will not be a problem as the structure of document is always same. The definition of the structure of document is known as ‘DTD (Document Type Definition)’. Once GML was designed, Goldfarb fine tuned his work and proposed the SGML (Standardized Markup Language) which was further approved by ISO (International Organization for Standardization) in 1986. SGML was not a language itself but it was a meta language to develop other markup languages. HTML (Hypertext Markup Language) is a derivative of SGML. HTML is more like a formatting language. Thus it is difficult to pull out what kind of data is stored inside a HTML document. Once this difficulty was understood, the need for domain specific tags was felt, for information interchange, which is not possible with HTML. Hence the XML was developed. It is always said that XML is more near to SGML when compared to HTML. 2. WHAT IS XML? According to the abstract from the XML Specification version 1: “The extensible Markup Language (XML) is a subset of SGML that is completely described in this document. Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML.” • XML stands for EXtensible Markup Language. • XML is a markup language much like HTML. • XML was designed to describe data. • XML tags are not predefined in XML. You must define your own tags. • XML uses a DTD (Document Type Definition) to describe the data. • XML with a DTD is designed to be self-descriptive. XML is still under development, & the following goals are kept in mind while developing the specification for XML. 1. XML shall be straightforwardly usable over the Internet. 2. XML shall be compatible with SGML. 3. It shall be easy to write programs which process XML. 4. The processors could read the XML document easily. 5. XML document should be human-legible and reasonably clear. 6. The XML design should be prepared quickly. 7. The design of XML should be formal and concise. 8. XML document shall be easy to create. 9. Terseness in XML is of minimum importance. 2.1. How XML is Different from HTML? 1. XML was designed to carry data. 2. XML is not a replacement for HTML. 3. XML was designed to describe data and to focus on what data is. HTML was designed to display data and to focus on how data looks. 4. HTML is about displaying information. XML is about describing information. 3. WHAT CAN BE DONE WITH XML? Paper: O Aditya Tripathi 3.1. XML does not DO Anything XML was not designed to DO anything. Maybe it is a little hard to understand, XML was not made to DO anything. XML is created as a way to structure, store and send information. To look into more detail let us write our first XML documents book.xml: Application of expert systems in libraries and information centres Anne Morris 1 Edition London Bowker-Saur 241 p. The example shows the structure of a document which describes a book, titled ‘Application of expert systems in libraries and information centres’. The book will have a title, author, edition, place, publisher, physical description elements. Author will be further divided into first name (f_name) and last name (l_name). Inside these tags the actual data is stored. If one browses the document in the browser, data will appear embedded in the tag without having any kind of formatting (Figure 1).