What is SGML ?

In this article, we are going to learn about SGML.SGML stands for Standard generalized markup language is a Standard generalized markup language that makes use of a superset of extensively used markup languages like HTML and XML. It is used for marking up files and has the gain of now no longer depending on a particular application.

It is basically derived from GML (Generalized Markup Language), which allowed users to work on standardized formatting styles for electronic documents. It was developed and standardized by the International Organization for Standards (ISO) in 1986. SGML  specifies the rules for tagging elements. These tags can then be interpreted to layout factors in specific ways.

It is used extensively to manipulate massive files which are a concern with common revisions and want to be published in one-of-a-kind formats due to the fact it’s far a massive and complicated system, it isn’t always but extensively used on private computers.

Components of SGML:

  • SGML provides a way of describing the relationships between these entities, elements, and attributes, and tells the computer how it can recognize the component parts of a document and it is based on the concept of a document being composed of a series of entities (object).
  • It provides rules that allow the computer to recognize where the various elements of a text entity start and end.
  • Document Type Definition (DTD) in SGML is used to describe each element of the document in a form that the computer can understand.

SGML is the simplest medium to produce files that can be read by people and exchanged between machines and applications in a straightforward manner. It is easy to understand by the human as well as the machine.

Structure of SGML:

<mainObject> 
    <subObject>  
    </subObject>
</mainObject> 

The extension of SGML files is: 

File_Name.sgml

Syntax:

<NAME TYPE="user">
   Beginner for Beginner
</NAME> 

Example 1: In this example, we will write code in SGML

SGML




<EMAIL>
    <SENDER>
        <PERSON>
            <FIRSTNAME>Beginner FOR Beginner</FIRSTNAME>    
        </PERSON>
    </SENDER>
    <BODY>       
        <p>A Computer Science Portal For Beginner</p>
    </BODY>
</EMAIL>


Output:

simple Paragraph

Example 2: In this example, we will see how to write code in SGML and its element.

SGML




<EMAIL>
    <RECEIVER>
        <PERSON>
            <FIRSTNAME>Krishna</FIRSTNAME>    
        </PERSON>
    </RECEIVER>
    <BODY>       
        <p>It is a name of the person.</p>
 
    </BODY>
</EMAIL>


Output:



Contact Us