Different markup languages other than HTML

Markup languages are computer languages that are used to structure, format, or describe relationships between various portions of text documents with the aid of symbols or tags introduced in the document. Compared to traditional programming languages with strict syntax, these languages are easier to read. There are several markup languages available but the most popular among them are discussed one by one. Let’s dive into the article for understanding different markup languages other than HTML.

XML

Extensible Markup Language (XML) is a markup language used to store structured data. The elements are defined by using custom tags, which support a variety of elements. It was developed, which could be extended to specify additional elements, while HTML was unable to do so.

XML was created with the ability to convey and store data as well as include sender, recipient, heading, and message body. It is more concerned with what the data is than with how it appears. It is employed to represent data, transactions, invoices, etc.

Example

Following is the example, where we are going to use the XML markup language.

<?xml version="1.0" encoding="UTF-8"?>
<message>
   <to>Customer</to>
   <from>Tp</from>
   <subject>Choose The Course</subject>
   <text>Apply Coupon</text>
</message>

When we execute the above code, it will generate an output consisting of text displayed on the webpage.

Features of XML

  • Effective data exchange
  • Independent of both software and hardware
  • with additional markup languages compatible
  • encourages platform switching
  • accepts Unicode

Drawbacks of XML

  • It features redundant syntax and is verbose in nature.
  • Its cost of transportation and storage is high.
  • Due to the redundant syntax, the files are typically large.

XHTML

HTML documents that accept custom tags to describe new elements are created using the markup language known as XHTML, or Extensible Hypertext Markup Language. In terms of handling errors, it is stricter than HTML; if there are mistakes in the markup document, the browser won’t show the webpage. The HTML document is converted into an XML version that needs to be properly marked up.

The document must contain certain necessary tags such as, <!DOCTYPE>, <html>, <head>, <title> and <body>. Additionally, if using XHTML, the <html> tag needs to have an xmlns attribute. DTD (Document Type Definition) declarations must be included in XHTML web pages. Following are the three different types of DTD.

  • Transitional DTD
  • Strict DTD
  • Frameset DTD

Example

In the following example, we are going to use the XHTML markup language.

<?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:56px;
      font-weight:bold;text-align:center;
      margin-bottom:-25px;">TUTORIALSPOINT</div>
   <p style="text-align:center;font-size:25px;"> The Best E-Way Learning </p>
</body>
</html>

On running the above code, the output window will pop up, displaying the text on the webpage with the applied CSS.

Let’s look into the some of the features and drawbacks of the XHTML markup language.

Features of XHTML

  • A markup language based on XML
  • Documents are simple to edit, convert, and maintain.
  • strict syntax and structural requirements
  • Format is clear, consistent, and organized.

Drawbacks of XHTML

  • Because of its tight rules, XHTML is more challenging to write than HTML.
  • It does have a fix for cross-browser compatibility problems.

SGML

A standard for establishing markup languages is provided by Standard Generalized Markup Language (SGML). In order to make files independent of other applications, they are marked up using this technique. To save SGML files, we uses .sgml extension. SGML works with large files that must undergo regular modifications and are a part of complex systems.

It establishes the connections between the entities, components, and characteristics of a document as well as the guidelines by which a computer system may recognize the beginning and end of an element. It offers the quickest method for transferring files directly between devices and program.

Let’s look into the some of the features and drawbacks of the SGML markup language.

Features of SGML

  • Platform-independent
  • Elements identified by various tags
  • Generic types and attributes are found in elements.
  • Use of delimiters and special characters on a regular basis

Drawbacks of SGML

  • It has a difficult connecting process.
  • Writing SGML code is quite difficult.

Related Posts

What are custom events in JavaScript?

Custom events are the events that allow you to decouple the code you want to run after a specific piece of code runs. There are various in-built events…

How to use nested for loop in JavaScript?

We use the for loop statement of JavaScript for repeating a set of statements inside the loop body a specified number of times. A nested for loop, as the…

What are the basic rules for JavaScript parameters?

A JavaScript function is a code that performs a particular task. The function parameters are the name list in the function definition. Parameters are also known as…

How to stop refreshing the page on submit in JavaScript?

Using event.preventDefault() to stop page refresh on form submit In this section, we will see how to use event.preventDefault() to stop page refresh on form submission. The event.preventDefault() restricts the default…

Target a Window Using JavaScript or HTML

TARGET attribute of HTML A link’s opening named frame or window is specified using the Target attribute of the <a> anchor tag. The concluding </a> tag in…

What is the role of deferred scripts in JavaScript?

Since JavaScript is a loosely typed language, you are not required to correctly predict the kind of data that will be kept in a variable. Depending on the information…