Difference Between XML and SGML

XML stands for extensible markup language. It is defined in the XML 1.0 specification, which is developed by the W3C (World Wide Web Consortium). XML provides a standard way, which is also simple, and encode data as text content could be exchanged through the hardware drivers, operating systems and applications without human intervention. SGML (Standard Generalized Markup Language) is an ISO (International Organization for Standardization) standard language for specifying a document up or a set of labels. SGML is a language of the document, but a Document Type Definition (DTD).


XML is a language that is used to transmit data and text between the hardware driver, operating systems and applications without human intervention. XML has tags, element structures and attributes that can be used for providing context information. Such context information can be used to decode the meaning of content. This makes it possible to develop effective search engines and perform data mining on the data. In addition, traditional relational databases are suitable as XML data because they could be organized in rows and columns, but XML provides less support for data with rich content such as audio, video, complexes, etc… The XML databases store data in a structured, hierarchical, which efficiently process the query. Tags in XML are not predetermined and users have liberty to define tags and document structures. Also, new language Internet as RSS, SOAP, XHTM and Atom were created by using XML.


SGML is based on the idea that although a document can be displayed with different appearances depending on the medium of production used, it contains some structural and semantic elements that do not change with respect to how it is displayed. The SGML-based documents can be created without concerning about the appearance of the document that can change overtime, but on about the structure of document. In addition, the compiler interprets a SGML document using the DTD, so these documents give more portability. Also, based on SGML documents could be easily re-adapted to various mass media (for example, the document intended for the medium of characters could be readapted for a display.

What is the difference between XML and SGML?

While XML is a language that is used to transport data and text between the hardware driver, operating systems and applications, SGML is an ISO standard language to specify an increase or a set of document label. XML is really a language which is based on up SGML. XML has some restrictions but it is not with SGML. For example, XML has some restrictions like: references of entity should be closed with REFC delimiter, external data references in content are not permitted, the character references should be closed with REFC delimiter, known character references are not allowed, etc… In addition, some constructions such as labels started early, opened late labels, labels start empty, end tags empty are allowed in SGML whereas SHORTTAG with YES, are not permitted in XML. Additionally, some statements as DATATAG SGML, OMITTAG, rank, LINK (SIMPLE, explicit and implicit), etc are not permitted in XML.


Category: VS  |  Tags: