0% found this document useful (0 votes)
299 views11 pages

Web Technologies (Topic - 04 SGML)

The document discusses Standard Generalized Markup Language (SGML), including its history, structure, syntax, components, characteristics, features, advantages, and disadvantages. SGML is a standard for defining markup languages that allows separation of document content from formatting. It formed the basis for HTML and XML.

Uploaded by

Raja Waqar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
299 views11 pages

Web Technologies (Topic - 04 SGML)

The document discusses Standard Generalized Markup Language (SGML), including its history, structure, syntax, components, characteristics, features, advantages, and disadvantages. SGML is a standard for defining markup languages that allows separation of document content from formatting. It formed the basis for HTML and XML.

Uploaded by

Raja Waqar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Course Title : Web Technologies

Course Code : DI 322


BS.IT 5TH Semester
Slides Made by: Areej Ali

Topic 4: SGML
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.

HTML was theoretically an example of an SGML-based language until HTML 5, which browsers cannot parse as SGML for
compatibility reasons. The SGML is extended from GML and later on it is extended to HTML and XML.
Structure of SGML:
<mainObject>

<subObject>

</subObject>

</mainObject>

The extension of SGML files is:


File_Name.sgml

Syntax:
<NAME TYPE="user">
AREEJ
</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:
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:
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.
Characteristics OF SGML
● The SGML Declarations.
● The Prologue, containing a DOCTYPE declaration with the various markup declarations that together
make a DTD i.e Document Type Definition.
● The instance itself, containing one top-most element and its contents.
Components of an SGML Document :
There are mainly three components of SGML document. They are –
1. SGML Declaration
2. Prolog
3. Document instance.
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.
Advantages
● It has the capability to encode the full structure of the document and can support any media type.
● It is of much more use than HTML which provides capabilities to code visual representation and not to
structure the real piece of information.
● Separates content from appearance.
● SGML files encoding is allowed for more complex formatting as compared to HTML.
● The Stylesheets present in SGML make the content to use for different purposes.
● Extremely flexible.
● Well supported with many tools available because of ISO standard.
Disadvantages
● It may be typical to code software in SGML.
● Tools that are used in SGML are expensive.
● It may not be used widely.
● Special software is required to run or to allow the document to display.
● Creating DTD’s requires exacting software engineering.

You might also like