Open In App

Explain different markup languages other than HTML

Improve
Improve
Like Article
Like
Save
Share
Report

Markup languages are computer languages that are used to structure, format, or define relationships between different parts of text documents with the help of symbols or tags inserted in the document. These languages are more readable than usual programming languages with strict syntax. There are several markup languages available but the most popular among them are as follows.

Table of Content

HTML:

Hypertext Markup Language (HTML) is a markup language used to create and link webpages. It defines the basic structure of a web page and contains meta-data about the page and a series of elements to be displayed on the web page. It uses predefined tags such as <table>, <form>, etc. to render different elements on the webpage. Each element requires a starting and ending tag with content inside it.
A marked-up document written in HTML is displayed by a web browser that interprets different tags and accordingly formats and structures the content of the document before displaying it. It can be written in a plain text editor and can be associated with styling sheets such as
CSS (Cascading Style Sheets)  and scripting languages such as JavaScript.

Example: Implementation of the basic structure of HTML code.

HTML




<!DOCTYPE html>
<html>
  
<head>
    <title>HTML Example Code</title>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
    <p>A computer science portal for geeks</p>
</body>
  
</html>


Output:

Output of HTML Code

Features:

  • It is easy to learn
  • Platform-independent
  • Support audio, video, and images embedded web pages
  • Supported by all browsers
  • Can be integrated with styling and scripting languages

Drawbacks:

  • It can only create static web pages because of its static nature.
  • It offers limited security features.
  • It requires long code for creating even a simple web page.

XML:

Extensible Markup Language (XML) is a markup language used for storing structured data. It uses custom tags to define the elements which support a wide range of elements. It was developed because HTML was unable to define new elements hence XML was introduced which was extensible to define custom elements.
It was designed to store and transport data and contain information about the sender, receiver, heading, and message body. It is more focused on what data is rather than how data looks. It is used for representing documents, data, transactions, invoices, etc. 

Example: Implementation of the basic structure of XML code.

XML




<?xml version="1.0" encoding="UTF-8"?>
<message>
    <to>Users</to>
    <from>GeeksforGeeks</from>
    <subject>Welcome message</subject>
    <text>Welcome to GeeksforGeeks</text>
</message>


Output:

Output of XML code

Features:

  • XML facilitates efficient data exchange.
  • XML is versatile, not bound to specific software or hardware.
  • XML easily integrates with other markup languages.
  • Smooth transitions between platforms are enabled by XML.
  • XML supports Unicode, ensuring compatibility for diverse characters.

Drawbacks:

  • It is verbose in nature and has redundant syntax.
  • It has high storage and transportation cost.
  • It generally has large file sizes due to redundant syntax.

XHTML:

Extensible Hypertext Markup Language (XHTML) is a markup language that is used to create HTML documents that support custom tags to define new elements. It is more strict than HTML in terms of error handling i.e browser doesn’t display web pages in case of errors in the markup document. It creates an XML version of the HTML document which must be marked up correctly.
It specifies some mandatory tags such as
<!DOCTYPE>, <html>, <head>, <title>, and <body> that should be present in the document. Also <html> tag should contain xmlns attribute in case of XHTML. It is necessary to include DTD (Document Type Definition) declaration in XHTML web page. There are three types of DTD as follows.

  • Transitional DTD
  • Strict DTD
  • Frameset DTD

Example: Implementation of the basic structure of the XHTML code.

XML




<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  
<head>
    <title>XHTML</title>
</head>
  
<body>
    <div style="color:#090;font-size:40px;
            font-weight:bold;text-align:center;
            margin-bottom:-25px;">GeeksforGeeks</div>
    <p style="text-align:center;font-size:20px;">
        A computer science portal
    </p>
</body>
  
</html>


Output:

Output for XHTML code

Features:

  • XHTML is built on XML, offering a structured and extensible markup.
  • It simplifies document maintenance, conversion, and editing.
  • XHTML enforces strict rules for syntax and structure.
  • XHTML ensures a clean, consistent, and well-structured document format.
  • It is compatible and accurate across various browsers.

Drawbacks:

  1. It is difficult to write XHTML code than HTML because of strict rules.
  2. It does have the solution for cross-browser combability issues.

SGML:

Standard Generalized Markup Language (SGML) is a markup language that provides a standard for defining markup languages. It is used for marking up files such that they are no longer dependent on any other application. It uses .sgml extension for saving SGML files. It manipulates massive files which require frequent revisions and is a part of complicated systems.
It defines the relationship between entities, elements, and attributes of a document and also defines rules that allow the computer system to identify the start and end of an element. It provides the simplest way to exchange files between machines and applications directly.

Example: Implementation of basic structure of SGML code.

XML




<MESSAGE>
    <FROM>GeeksforGeeks</FROM>
    <TEXT>Welcome to GeeksforGeeks</TEXT>
</MESSAGE>


Output:

Features:

  • SGML is platform-independent, allowing for versatility in different environments.
  • SGML represents elements using distinct tags for clarity and organization.
  • Elements in SGML have generic types and attributes, enhancing flexibility.
  • SGML maintains consistent usage of delimiters and special characters for uniformity.
  • SGML supports string substitution for standard boilerplate text, streamlining document creation.
  • SGML facilitates effective document management, aiding in organization and retrieval.

Drawbacks:

  • It has a complex linking procedure.
  • It is very hard to write SGML code.


Last Updated : 11 Jan, 2024
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads