Open In App

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 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">
   Geeks for Geeks
</NAME> 

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




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

Output:

simple Paragraph

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




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

Output:


Article Tags :