• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • NCERT Solutions
    • NCERT Books Free Download
  • TS Grewal
    • TS Grewal Class 12 Accountancy Solutions
    • TS Grewal Class 11 Accountancy Solutions
  • CBSE Sample Papers
  • NCERT Exemplar Problems
  • English Grammar
    • Wordfeud Cheat
  • MCQ Questions

CBSE Tuts

CBSE Maths notes, CBSE physics notes, CBSE chemistry notes

CBSE Notes for Class 10 Foundation of Information Technology – Introduction to XML

CBSE Notes for Class 10 Foundation of Information Technology – Introduction to XML

XML stands for extensible Markup Language. It is a software and hardware independent tool for carrying information. XML is a text-based markup language, in which you can create your own tags for processing and displaying data in a structured format.
In recent years, XML has evolved as the efficient standard for document markup, because it provides customised tags to fobrmat and display textual information.
XML is a way to apply structure to a Web page. It will not change the way of your Web page look, but it will change the way, the documents are read and the way documents are filled and stored. The XML format can be used by any individual or group of individuals or companies that want to share infomation in a consistent way.

IS XML A PROGRAMMING LANGUAGE?
XML does not qualify to be a programming language as it does not perform any computation or algorithms. It is usually stored in a simple text file and is processed by special software that is capable of interpreting XML.

HISTORY OF XML
The concept of XML begins in the 1960’s. Its origins are in the standardised typesetting codes GENCODE used by the publishing industry.
In the 1969’s, three persons at IBM named Dr. Charles F. Goldfrab, alongwith Ed. Mosher and Ray Lorie invented GML (Generalised Markup Language), a generic way to store content for automated publishing to convert the content for publication on multiple systems.
This language uses tags to format the text of a file. The basic intentions of GML were as follows:
(i) Markup (set of rules) should emphasise the document structure, not format or style.
(ii) Simple input syntax for markup using <> and </> tags.
(iii) Markup syntax rules should be fully controlled.
So, that the code can be read easily by the people and the programmers.
The main disadvantage of GML is different files created by GML required different parsers.
GML led to the development of Standardised Generalised Markup Language (SGML) was standardised and released by ISO in 1986.
The main purpose of SGML was to create vocabularies which could be used to markup documents with structural tags. Since, the software used to create SGML files was complex and expensive, this led to the development of HTML (HyperText Markup Language) by Tim Berners Lee in the late 1980’s.
Since, HTML has somewhat become a victim of it’s own popularity, as it was rapidly adopted and extended in many ways beyond its original vision. But, HTML is only intended for displaying files in a browser and it remains popular today also, though as a presentation technology and is considered unsuitable as a general purpose data storage format. This led to the development of XML.
Since, XML is originated from SGML, which is a system for defining new markup languages. A system that allows defining new markup language is known as meta language and hence by being both human and machine readable. SGML and XML are both the meta languages.

XML Usage
A short list of XML usage says it all:

  • XML can work behind the scene to simplify the creation of HTML documents for large Websites.
  • XML can be used to exchange the information between organisations and systems.
  • XML can be used for offloading and reloading of databases.
  • XML can be used to store and arrange the data, which can customize your data handling needs.
  • XML can easily be merged with stylesheets to create almost any desired output.

FEATURES OF XML
The most common features of XML are as follows:

  1. XML simplifies data description The focus of XML is only on the description of data, not on presentation of data.
  2. XML is a structured format We can define exactly, how the data is to be arranged, organised and expressed within the file.
    When we are given a file, we can validate it, confirms to a specific structure, prior to importing the data. XML is a user defined language, implying that it allows you to create your own tags.
  3. XML can easily describe hierarchical data and the relationship between them It
    provides the relationship between root element and its child elements. The hierarchical structure is suitable for most types of documents.
  4. XML is platform-independent It can run on all platforms. XML data is stored in text format. This makes it easier to expand or upgrade to new applications, new browsers, without losing data. It enables you to execute XML based applications on any operating system.
  5. XML is free and extensible In XML, tags are not predefined. It means that it supports user-defined tags which user can define as per the own requirement.
  6. XML is a global format There is only one way to express a number in an XML file and only one way to express a date.
  7. XML is a meta language It can be used to create new languages. There are several languages derived from XML such as follows:
  • MathML
  • Wireless Markup Language (WML)
  • Ink Markup Language (InkML)
  • Business Narrative Markup Language (BNML)
  • Financial Product Markup Language (FPML)
  • Virtual Human Markup Language (VHML)
  • Architecture Description Markup Language (ADML)
  • Artificial Intelligence Markup Language (AIML)
  • Chess Markup Language (ChessML) etc.

COMPONENTS OF XML DOCUMENT
An XML document is composed of many things like declarations, list of instructions to be processed, elements and comments. An XML document contains the following two components:
1. Prolog
It is an introduction to the XML document. It outlines the order and content of initial prolog in an XML document. It should be the first logical component. But, the XML prolog is an optional piece of information. .
The prolog contains the following components, all of these are optional, either we can use it in syntax or not.
(i). XML Declaration
It refers to a statement, which is used to indicate the specified XML document. It defines the XML version and character encoding used in the document.
Syntax

<?xml version="version_number"
 encoding="encoding_decl a rati on"
 standalone="standalone_status" ?>

Each parameter consists of a parameter name, an equal sign (=) and parameter value inside a double quotes. Following table shows the above syntax in detail:

Parameter Parameter value Parameter description
Version 1.0 It specifies the version of the XML standard used.
Encoding

UTF-8,
UTF-16 etc.

It defines the character encoding used in the document. By default, UTF-8 encoding is used.
Standalone yes or no The ‘yes’ value specifies that the XML document has an external entity like DTD and the ‘no’ value specifies that the XML document is linked to an external entity. The default value is set to ‘no’.

An XML declaration should abide with the following rules:

  • If the XML declaration is present in the XML, it must be placed as the first line in the XML document.
  • If the XML declaration is included, it must contain version number attribute.
  • The parameter names are always in lowercase.
  • The values are case-sensitive and either single or double quotes may be used. .
  • The order of placing the parameters is important. The correct order is: version, encoding and standalone.
  • The XML declaration has no closing tag, i.e. </?xml>
    e.g.

     <?xmi versi on=" 1.0" encodi ng="UTF-8" standalone="no" ?>

(ii) Processing Instructions (PI)
PI can be used to pass information to applications in such a way that escapes most XML rules. Its main use is of linking to an XML stylesheet in the prolog of an XML document. Processing instructions do not have to follow much internal syntax, it can include markup characters without escaping them and can appear anywhere in the document.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-1
The attributes of PI are as follows:
(i) href refers to the name of stylesheet. URI is the Uniform Resource Identifier of the stylesheet. This URI is relative to the location of the XML document itself.
(ii) type refers to the type of stylesheet. It may be text/css(to link to a cascading stylesheet file) or text/xsl (to link to an XSLT file).
e.g.

<?xml-stylesheet type="text/xsl"
 href="show_book.xsl"?>
 or
 <?xml-stylesheet type="text/css"
 href="examp1e.css"?>
 

(iii) Document Type (DOCTYPE) Declaration
The document type (DOCTYPE) declarations are used in XML to specify information about a document, including the document’s root element and DTD.
The DTD consists of an internal or references an external file. It can also have a combination of both internal and external DTD.
DOCTYPE declaration can contain:

  • The name of the document or root element.
  • Define elements, attributes, entities, notations and comments to the document (internal) DTD.
  • Identifies an external DTD for the document.

The document type declaration begins with the <! D0CTYPE> declaration.
Syntax

<!DOCTYPE dtd_name
 SYSTEM="dtd_fi1e_name.dtd">
 e.g.
 <!DOCTYPE PRODUCT SYSTEM="pro.dtd">

The simplest DOCTYPE declaration identifies only the root element of the document.

<!DOCTYPE rootelement>

DOCTYPE declarations can also include declarations directly, in which it is referred to as an internal subset. If a DOCTYPE declaration includes the entire DTD directly, about reference to external files or external subset, it uses following syntax:

<!D0CTYPE rootelement
SYSTEM="URI reference" [declarations]>

iv. Comments
It explains how comments can be made in XML as a means of annotating in an XML document.
It is used to leave a note or to temporarily edit out a portion of XML code that appears in the code of an XML document to understand the code better. XML comments have the exact same syntax as HTML comments have.
Syntax

<!--This is a comment-->
 e.g.
 <!--Students grades are updated bi-monthly-->
 

Make sure that two “hyphens” do not appear in a comment except in the beginning (<! —) and at the end (—>).
v. White Space and New Line
It refers to the blank or empty spaces in the XML document. White spaces include spaces, tabs, CR’Carriage Returns, blank lines and LF-Line Feed. XML stores a new lines as LF. You can add white spaces by spacebar, TAB or ENTER key.
White space is generally provided to enhance the reliability of the document. XML parser ignores these white spaces. You must notice in HTML, the multiple spaces between the words are reduced to a single space, when HTML code is navigated in the Web browser.
e.g. when white space in HTML
HTML It is my HTML code.
Output It is my HTML code,
e.g. when white space in XML
XML It is my XML code.
Output It is my XML code.

2. Data Instance
Sometimes, data instance is also referred to as body of the XML document. It follows the prolog and consists of one or more elements, which contains the actual data. The basic building blocks of data instance are elements, which contain the data items present in the XML document and begins with a start tag and ends with an end tag.
Data instance contains the various components which are as follows:
i. Root/Document Element
Each XML document has exactly one single root element. This element is known as the document or root element. It encloses all the other elements and therefore atleast one element there that will be sole parent to all the other elements. Root element is also called Parent element. Root or document elements are not any keywords.
Syntax

<Root>
 <Chi1d>
 <Subchild>..........</Subchild>
 </Chi1d>
 </Root>
 e.g.
 <School>
 <Student>
 <Ro11 No> 12 </Rol1 No>
 </Student>
 </School>

In the above example, is a root element.
ii. Elements
These are the basic units used to identify and store data and are represented by using tags. Also, an element can contain another element text.
Elements can be divided into two basic categories which are as follows:
(a) Empty Elements If an element does not have any content, it is called an empty element. It can have attributes that help to identify an entity. An empty element can be written without the end tag.

e.g.
 </Product>
 < Item item_id="24"/> ) Empty element
 </Product>

(b) Child (Nested) Elements A child element is a nested element, i.e. element inside another element. An element that contains child element is known as the parent element.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-2
iii. Tags
These are used to identify elements in an XML document. XML tags consist of opening and closing angular brackets (<>).
You can use these tags to mark the start and end of elements, which are the logical units of information in an XML document. An element consists of a start tag, possibly followed by content and other complete elements, followed by an end tag.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-3
Three types of tags are as follows:

  • Start Tag It is a tag name, which is placed inside angular brackets (<>). It starts the definition of an element.
    e.g. <tag>
  • End Tag It is a tag name, which has same name as that of its start tag, but alongwith a slash before the name.
    e.g. </tag>
  • Empty Tag It is a tag without end tag. It is a tag name following slash.
    e.g. <tag/>

iv. Attributes
In addition to marking the beginning of an element, XML will start with tags to provide a place to specify attributes. An attribute specifies a single property of an element, using a name-value pair. Every attribute assignment consists of two parts, the attribute name and the attribute value.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-4
All attributes value must be enclosed in single or double quotation marks.
v. Content
The content of an XML document is contained in the elements used in the document.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-5
vi. Special Characters
Special characters are also known as predefined entities. It is a short name given to a set of information. When a special character is used in an XML document, it expands its full definition. It is a shortcut for the associated block of data. Special characters are also called references.
Some special characters are as follows:

Character Predefined Entity
& &amp;
< &lt;
> &gt;
“ quot;
‘ apos;
e.g. <NAME> HTML &apos; XML </NAME>
 Output HTML’ XML

CREATING A SIMPLE XML DOCUMENT
Before you create an XML document, you need to understand how data is stored in an XML document and the various components of an XML document.
XML provides a way to store structured data that is capable of being recognised by different kinds of devices,
e.g. the code of an XML document is as follows:
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-6
In the above example, XML declaration line specifies the version and encoding format of the XML document.

STRUCTURE OF XML DOCUMENT SYSTEM
When it is felt that the need to process an XML document on Web in the desired format, a complete XML document system is required.
XML defines certain rules for syntax that specify how to structure an XML document. The syntax used to create an XML document is called Markup Syntax.
The XML document system is a combination of the following types of documents:
(i) Semantic of data (XML file or document) It contains the actual data.
(ii) DTD It refers to Document Type Definition. It defines the structure and grammar rules for an XML document. DTD provides a framework to validate XML documents. Also, it defines the structure of an XML document with a list of legal elements.
(iii) StyleSheet It refers to the document that defines the style or appearance for the XML document. It will define the styles of the elements, i.e. their color, font, alignment etc.

There are two types of stylesheets used in XML:

  1. XSL (extensible StyleSheet Language)
  2. CSS (Cascading StyleSheet)
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-7

Structure of XML – File/Document
Every XML document includes both physical and logical structure which are as follows:
1. Physical Structure
It contains the actual data used in a document. The basic storage unit called entity, each of which may refer to other entities. An entity has a name and content. It contains references to other entities. There is a special entity called document entity or root, that serves as a main storage unit. XML processor always start document processing from that unit.
We have three classifications of entities, these are as follows:
i. Internal and External Entities
For internal entity, there is no separate physical storage object and the content of the entity is given in the declaration. It contained inside the document. If the entity is not internal, then it is an external entity.
ii. General and Parameter Entities
General entities are entities which are used within the document content. In this specification, general entities are sometimes referred to with the unqualified entity, when this leads to no ambiguity. Generally, entities are declared and used differently. Parameter entities are parsed and used only in the DTD part of the XML document.
iii. Parsed and Unparsed Entities
Parsed entities contain text that is referred as replacement text intended to be processed by the parser and is considered as an integral part of the document. Unparsed entities are resources that can be of any type including text objects. This type of entity is never process by parser.

2. Logical Structure
It is a template that enables the elements to be included in a document and in the order in which they have to be included.
The logical structure includes the basic components of the XML document. It indicates how a document is built, irrespective of what a document contains. The first structural element is prolog which is the base for the logical structure.
The structure of the document of example code:
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-8
TYPES OF XML DOCUMENTS
There are two types of XML documents as follows:
1. Well-Formed XML Documents
A “Well-Formed” XML document means that document has the correct XML syntax.
The XML document that follows XML grammar rules is called well-formed document. A document that includes sequence of markup characters that cannot be parsed or are invalid cannot be well-formed. The following points are to be kept in mind for a valid XML document:

  • The document must contain atleast one element
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-9
  • The document must have a root element A root element is a unique element in the XML document, which contains the complete document.
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-10
  • The element must have the opening and the closing tags To close a tag, you need to prefix the forward slash with the normal tag.
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-11
  • XML tags must be closed properly There must be a proper closing tag. In XML, empty tags must end with a following slash.
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-12
  • XML elements must be properly nested The parent element has to be opened before the child element and closed after the child element
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-13
    This code is not well-formed because the root element (College) is closed before the parent element (Student).
  • XML tags are case sensitive XML tags are case sensitive means the opening and ending tags must be in the same case.
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-14
  • (vii) XML attribute values should be in double quotation marks The attribute value in an XML document should be enclosed in proper quotes.
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-15

2. Valid XML Document
A valid XML document is .not only a well-formed document but as well as they also checked error against a DTD or schema. DTD is a set of rules that defines what tags appear, what value those tags may contain and how the tags are related to each other in an XML document. Validation can be done only if the XML document has valid DTD. When an XML document is checked or parsed according to a particular structure or guidelines, the process is known as validation of the document.

Software that Validate XML Documents
There are two types of software, which enable DTD to run XML document in proper manner, when it gets executed.
i. XML Validator
This is the software package that validates your XML document according to the DTD specification and give information about the document, i.e. program will stop processing an XML document if it finds an error because XML software is small, fast and compatible.
Some common XML validators on Web are as follows:

Validator Source
W3C Validation Service http://validator.w3.org/
Brown
University’s
http ://www. stg. brown. ed u/service/xml-val id/
R.UWF?
XML.com’s
http://www.xml.eom/pub/a/tools/ruwf/check.html
Tidy http://www.w3.org/People/Raggett/tidy/

ii. XML Parsers
These are software programs that check the syntax and structure used in an XML file. Parser reads, writes and manipulates the XML documents.
The role of an XML parser is to cut a part of a valid XML document to obtain actual data from the XML document.
If the parser reads the file against the DTD description, it is known as a validating parser. An XML parser converts an XML document into an XML DOM (Document Object Model) object, which can be manipulated with JavaScript.
Some XML parsers are as follows:

XML Parser Source
LT-XML http ://www. itg. ed. ac. uk/software/xm 1/
SAX (Simple API for XML) http ://www. saxproject.org/
expat http ://expat. sou reef orge. net/
TcIXML http://tclxml.sourceforge.net/
XML4J(XML for Java) http ://al phaworks. i bm. com/tech/xml4j
Xerces http://xerces.apache.org/

Validation Process
XML validation is the process of validating an XML document.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-16
Above example means an e-mail can contain the fields as, to, from, heading and body. To define the structure of this document, a DTD can be created which can be a part of the XML document itself.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-17
CSS (CASCADING STYLE SHEET)
CSS is a simple design language intended to simplify the process of making Web pages presentable.
It was developed by Hakon Wium Lie on October 10, 1994 and maintained through a group of people within the W3C called the CSS Working Group.
CSS handles the look and feel part of a Web page. It saves a lot of work. It can control the layout of multiple Web pages all at once.
CSS is used to define styles for your Web pages, including the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized, what background are used etc.
The CSS document, which has .css extension, contains the style code and layout of an XML document, such as font size, font color, line width and background color. You can use a stylesheet to:
Change the format of an XML document.
Describe how to present the transformed information.
CSS is a type of stylesheet and this stylesheet consists of a list of rules. You can include a CSS in multiple XML documents that have the same data structure.
Syntax

selector
 {
 'property: value; } Declaration Block
 }

1. Selector It is an XML element in which the CSS style is applied usually on an HTML element like <h1>, <title> ,etc. It is simply the element that relates the document with a particular style. Also, when multiple selectors are joined, the order of the selectors is important.
2. Declaration Block The declaration block can contain one or more declarations separated by a semicolon!;).
Each declaration contains a property name and value, separated by a colon(:).
(i) Property It is a type of attribute of HTML element. Put simply, all the HTML attributes are converted into CSS properties. It could be color, border etc.
(ii) Value These are assigned to properties, e.g. color property can have value either red or #FF0000 etc.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-18
If there are multiple declarations in a block a semicolon (;) must be inserted to separate each declaration. Multiple style declarations for a single selector may be written as:

Selector {property 1 : value 1;
 property 2 : value 2; )
 e.g. Title {color : green; font-family : arial;}

To decrease repetition of statements within stylesheets, we can use the grouping of selectors. Style declaration for a multiple selector having common style-rule (grouping) may be written as:

Title,Name,Heading{color:green;font-family: a r i a 1 ; }

Creating a CSS File
To create a CSS file, you need to have all the style rules composed in it and save it with extension .css.
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-19
You can define the color in CSS by name as well as by code like green color may be written as #008000 or rgb(0,128,0).

Using CSS with an HTML Document
To link an HTML document with a stylesheet, perform the following steps:
(i) Create an HTML document and save it as a file with the .html extension.
(ii) Create a separate CSS stylesheet and save it as a file with the .css extension.
(iii) Link both the files using following code:
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-20
This code must be part of the html document, which is to be linked with a CSS stylesheet namely “test.css”.
Using CSS with an XML Document
To link an XML document with a stylesheet perform the following steps:
(i) Create an XML document and save it as a file with the .xml extension.
(ii) Create a stylesheet and save it as a file with the .css , extension.
(iii) Link both the files in the XML document by using the PI.

<?xml-stylesheet href = "test.css"
 type = "text/css"?>
e.g. The following is the CSS document:
 People
 {
 background-color : light green;
 display : block;
 padding : 5px;
 font-family : arial ;
 }
 Person
 {
 background - col or : pink;
 border : 2px solid black;
 display : block;
 margin-bottom : 5px;
 }
 Name
 {
 font-family : bold;
 display : block;
 }
 Birthdate
 {
 display : block;
 }
 Eyes
 {
 display : block;
 }

Now, save it as test.css
 The following is the XML document:
 <?xml version="l.0" encoding="UTF-8"?>
 <?xml-stylesheet type = "text/css"
 href = "test.css"?>
 <People>
 <Person>
 <Name>A</Name>
 <Birthdate>Jan 24, 1987</Birthdate>
 <Eyes>Blue</Eyes>
 </Person>
 <Person>
 <Name>B</Name>
 <Birthdate>Dec 15, 2009</Bi rthda'te>
 < Eyes >Brown</Eyes >
 </Person>
 </People>
 Now, save it as test 1.xml

Viewing the XML Document in the Browser
To see the XML document in the browser, you have to take the same steps as you do in HTML.
Once the CSS and XML documents are created in the same folder, double click the XML document and see the document browsing on the Web browser as per stylesheet or CSS file.
e.g. double click on the file test 1.xml to open it in the browser. It will look as follows:
cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-21
COMPARING XML AND OTHER TECHNOLOGIES
XML is a markup language, but there are various other markup languages, such as SGML, EDI and HTML which are also available.
1. Comparing XML and SGML

XML SGML
XML is a markup language. SGML is a meta language used to define and describe generic markup language.
It does not include complex and optional features of SGML. It is complex and requires overheads to use it.
XML allows creation of new  tags to describe and present your data. It is an ISO standard for specifying a set of tags
XML allows data validation. SGML does not allow data validation.
It describes the data and transfers data between applications. It allows you to define and create platform-independent files.

2. Comparing HTML and XML

HTML XML
HTML tags are predefined. XML tags are not predefined.
HTML is case insensitive. XML is case sensitive.
HTML is markup language that creates the form and appearance of the Web page. XML is neither a programming nor a presentation language.
HTML documents are viewable in a browser. XML documents can be viewed only if proper stylesheet file is also available alongwith XML file.
HTML tags may or may not have closing tags. XML tags must have a closing tags.

3. Comparing EDI and XML

EDI XML
EDI (Electronic Data Interchange) is a collection of standards, formats and file layout. XML is an emerging standard designed to simplify Web-based E-Commerce transactions between computer application.
EDI enables highly secure document exchanges. XML document typically needs to be encrypted to maintain security level.
EDI documents are sent via private and relatively expensive Value Added Networks (VANs). XML documents are generally sent via the Internet.
EDI does not processes low transaction values. XML processes relatively low transaction values.
EDI allows companies to exchange electronic documents quickly between their trading partners. XML allows you to create custom tags to present your document in a structured format.

DIFFERENCE BETWEEN XML AND HTML
We are now discussing the difference between XML and HTML according to the following parameters:

  1. Data Separation
    If you need to display dynamic data in your HTML document, it will take lot of work to edit the HTML each time when the data changes. Data is often stored inside HTML pages. With XML, this data can be stored in a separate XML file. This way you can concentrate on using HTML for layout and display and be sure that changes in the underlying data will not require any changes to the HTML.
    You can also store XML data inside HTML pages using the tag, which is known as Data Island in the HTML file. You can still focus on formatting and displaying the data in an HTML file. .
  2. Data Sharing
    In the real world, computer systems and databases contain data in incompatible formats. XML data is stored in plain text format.
    This provides a software and hardware independent way of storing data. This makes it much easier to create data that different applications can share.
    HTML also allows you to present and share data, but it has following limitations:
    (i) It is a presentation oriented technology not content oriented.
    (ii) It does not have data validation capabilities.
    (iii) It does not allow creation of user-defined tags.
    In contradiction, XML having following advantages over HTML:
    (i) With XML, you can transfer data over the Internet quickly and reliably.
    (ii) With XML, you can view the same data in multiple ways with the help of different user groups and applications.
    (iii) Allows you to validate data structure by defining DTD.
  3. Document Structure
    The structure of XML and HTML documents are represented in a tree-like structure. XML allows you to define and store the document structure and structure of data through schemas or DTDs while HTML does not have any facility to define the document structure and data structure.
  4. Tags
    The tags in XML language are not predefined. You can create your own tags and use them according to your need. However, in the case of HTML, tags are predefined. You cannot extend tag capability in HTML.
  5. Nesting of Elements
    Both XML and HTML languages support hierarchical format that means you can nest the elements. Nesting of elements in HTML does not convey any meaning,
    e.g.

    <Student>
    <Enrol l ment_number>...<
    /Enrollment_number>
    <Rol l_number>...</Rol l_number>
    <Name>...</Name>
    </Student>

    It is clear that inner tag cannot nest outer tags that means the parent element has to be opened before the child element and closed after the child element.

  6. Elements, Attributes and Values
    HTML elements are predefined, whereas XML elements are created as per user choice. Attributes are used to provide additional information about element in XML and HTML both. An attribute is a name-value pair contained in the element’s start tag.
    If some data must be displayed, then it should be presented through an element. However, if some data serves the informatory purpose and does not need to be displayed, it can be presented through attribute.
    cbse-notes-for-class-10-foundation-of-information-technology-introduction-to-xml-22
    One difference between HTML and XML attributes is that the value of attributes in XML must be enclosed within double quotes, but in HTML, the double quotes are not required.
    Another difference is that you can reframe XML attributes as elements. But, you cannot write HTML attributes as elements.

Advantages of XML
Some advantages of XML are as follows:

  • Information coded in XML is easy to read and understand and it can be processed easily by computers.
  • Provides a basic syntax that can be used to share information among different applications.
  • Supports multilingual documents and Unicode.
  • XML is fully compatible with Java.
  • Separates content from presentation.
  • Used to share data and application models over the Internet.
  • XML documents can be stored in databases.
  • Allows you to represent hierarchical data in plain text.
  • XML is a platform-independent language and allows you to create your own tags according to your requirements.
  • XML is an extendable language.
  • It has a simultaneously human and machine readable format.

Disadvantages of XML
Some disadvantages of XML are as follows:

  • More difficult, demanding and precise than HTML.
  • Lack of browser support/end user applications
  • Syntax is redundant or large relative to binary representation of similar data.
  • XML is commonly depicted as “self-documenting” but his depiction ignores critical ambiguities.
  • No intrinsic data type support.
  • XML namespace are problematic to use.

Foundation of IT

Primary Sidebar

NCERT Exemplar problems With Solutions CBSE Previous Year Questions with Solutoins CBSE Sample Papers

Recent Posts

  • NCERT Class 10 Science Lab Manual – pH of Samples
  • NCERT Solutions for Class 11 Hindi Core – काव्य भाग – मेरे तो गिरधर गोपाल दूसरो न कोई, पग घुँघरू बाधि मीरां नाची
  • ML Aggarwal Class 7 Solutions for ICSE Maths Chapter 16 Perimeter and Area Ex 16.1
  • NCERT Solutions for Class 12 Chemistry Chapter 12 Aldehydes, Ketones and Carboxylic Acids
  • Magnetic Effects of Electric Current Class 10 Important Questions with Answers Science Chapter 13
  • Question Tags Exercises for Class 8 CBSE With Answers – English Grammar
  • NCERT Solutions for Class 12 Hindi Core – पूरक पाठ्यपुस्तक-सिल्वर वैडिंग
  • Light Reflection and Refraction Class 10 Important Questions with Answers Science Chapter 10
  • ML Aggarwal Class 8 Solutions for ICSE Maths Chapter 18 Mensuration Ex 18.3
  • NCERT Solutions for Class 12 Chemistry Chapter 11 Alcohols, Phenols and Ehers
  • NCERT Solutions for Class 11 Hindi Core – गद्य भाग – जामुन का पेड़
  • MCQ Questions for Class 8 Science Chapter 16 Light with Answers
  • NCERT Class 9 Science Lab Manual – Law of Conservation of Mass
  • NCERT Class 9 Science Lab Manual – Plant and Animal Tissues
  • CBSE Notes for Class 7 Computer in Action – Looping Statements in QBASIC

Footer

Maths NCERT Solutions

NCERT Solutions for Class 12 Maths
NCERT Solutions for Class 11 Maths
NCERT Solutions for Class 10 Maths
NCERT Solutions for Class 9 Maths
NCERT Solutions for Class 8 Maths
NCERT Solutions for Class 7 Maths
NCERT Solutions for Class 6 Maths

SCIENCE NCERT SOLUTIONS

NCERT Solutions for Class 12 Physics
NCERT Solutions for Class 12 Chemistry
NCERT Solutions for Class 11 Physics
NCERT Solutions for Class 11 Chemistry
NCERT Solutions for Class 10 Science
NCERT Solutions for Class 9 Science
NCERT Solutions for Class 7 Science
MCQ Questions NCERT Solutions
CBSE Sample Papers
NCERT Exemplar Solutions LCM and GCF Calculator
TS Grewal Accountancy Class 12 Solutions
TS Grewal Accountancy Class 11 Solutions