0% found this document useful (0 votes)
44 views10 pages

Introduction To XML: Informatics Practices Class XII By-Rajesh Kumar Mishra KV No.1, AFS, Suratgarh (Raj.)

The document introduces XML (eXtensible Markup Language) and describes its key features and uses. XML allows creating application-specific structured documents using custom tags. It is derived from SGML and is a meta language that is extensible, platform independent, and supported by W3C. The document provides examples to demonstrate how to create an XML document with a data structure and link it to a style sheet to control formatting for display.

Uploaded by

Sanjyoti Singh
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)
44 views10 pages

Introduction To XML: Informatics Practices Class XII By-Rajesh Kumar Mishra KV No.1, AFS, Suratgarh (Raj.)

The document introduces XML (eXtensible Markup Language) and describes its key features and uses. XML allows creating application-specific structured documents using custom tags. It is derived from SGML and is a meta language that is extensible, platform independent, and supported by W3C. The document provides examples to demonstrate how to create an XML document with a data structure and link it to a style sheet to control formatting for display.

Uploaded by

Sanjyoti Singh
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/ 10

Chapter 13:

Introduction to XML

Informatics Practices
Class XII

By- Rajesh Kumar Mishra


PGT (Comp.Sc.)
KV No.1, AFS, Suratgarh (Raj.)
e-mail : [email protected]
What is XML?

eXtensible Markup Language (XML) is a


text-based mark-up language which
allows to create application specific
structured documents.
XML is meta language i.e. you can
create new tags.
XML is derived from SGML (Standard
Generalized Mark-up Language) which
was used to define a new Mark-up
languages.
HTML v/s XML
HTML and XML both are different types of Mark-up language.
 HTML
 HTML documents format and displays web page’ data.
 HTML Tags are pre-defined.
 HTML Tags may be Empty type.
 HTML Tags are not case sensitive.
 HTML documents are directly viewable in a Browser.
 XML
 XML documents carry data along with their description.
 XML Tags are not pre-defined. You may create your own Tags.
 XML Tags must be Container type.
 XML Tags are case sensitive.
 XML documents are viewable if its Style Sheet is available.
Features of XML

The common feature of XML are-


 XML was designed to carry data, not to display.
 XML is self-Descriptive, (Tags are not predefined).
 XML is free and Extensible ( It is Meta Language).
 XML is platform Independent.
 XML may be used to create a new Mark-up
Language.
 It is supported and recommended by W3C.
Structure of XML Document System

A XML Document is intended to display data like HTML.


An XML document system comprises the following-
 Style Sheet (CSS or XSL)
It defines the style (How it would appear i.e. font,
color, size alignment etc.) of the elements.
 Grammar Structure (DTD)
It is optional component in XML document system
and defines the Rules of the document (Tag
definitions).
 XML File
It contains and describes actual data.
How to Prepare XML Document
In order to prepare XML Document system, you may
do the following steps-
 Prepare XML document file as per problem
XML document is divided into two part.
1. The Prolog :
Preface or Introduction to the XML document. It
includes An XML declaration, Comments etc.
1. The Data Instance :
It contains actual data.
 Prepare a style-sheet file for XML file
It contains style rules that tells a browser how to
display an XML document.
 Link the XML file with Style sheet
Example to create XML document.
 Expected View on Browser
Computer Parts

Suppose we
Mother Board
want to make an
XML document
Asus
which is
P3B-F
displayed in
1230.00
browser as
shown here
TFT Monitor

LG Electronics
995e
8500.00
Example to create XML document.
 Preparation of XML (test.xml) document Prolog

<?xml version=“1.0” encoding = UTF-8“ standalone=“no” ?>


<?xml-stylesheet type=“text/css” href=“parts.css”?>
<PARTS>
<TITLE> Computer Parts </TITLE>
Linking of .css
<PARTS> (Style Sheet)
<PARTNAME>Mother Board</PARTNAME> file
<MANUFACTURER>Asus</MANUFACTURER>
<MODEL>P3B-F</MODEL>
<COST>1230.00</COST>
Data
</PART>
Instance
<PARTS>
<PARTNAME>TFT Monitor</PARTNAME>
<MANUFACTURER>LG Electronics</MANUFACTURER>
<MODEL>995e</MODEL>
<COST>8500.00</COST>
</PART>
</PARTS>
Example to create XML document.
 Preparation of Style Sheet (part.css)
file
PARTS {display:block}
TITLE {display:block; font-fanily:arial; color:#008000;
font-weight:600; font-size:16 margine-top:12pt;
text-align:center}
PART {display:block}
PARTNAME {display:block; font-fanily:arial; color:#008000;
font-weight:400; font-size:14 margine-left:10pt;
margin-top: 10pt}
MANUFACTURER {display:block; font-fanily:arial; color:#600060;
font-weight:400; font-size:14 margine-left:30pt;
margin-top: 10pt}
MODEL {display:block; font-fanily:arial; color:#600060;
font-weight:400; font-size:14 margine-left:30pt;
margin-top: 10pt}
COST {display:block; font-fanily:arial; color:#800000;
font-weight:400; font-size:14 margine-left:30pt;
margin-left: 5pt}
Why XML is used (Advantages)

XML offers the following advantages-


 XML is fully compatible to various application
developed in Java or any other languages.
 XML is portable and can be used on any network
or hardware like palmtop or PDAs.
 XML is Extensible i.e. You may create your own
tags.
 XML is platform Independent.
 XML document can be stored in the database.
 XML can be used to share data within wide area
networks. It is most suited to Internet.

You might also like