SlideShare a Scribd company logo
1 of 11
INTRODUCTION TO XML
BY
SANA MATEEN
INTRODUCTION
• XML stands for Extensible Markup Language and is a text-based markup
language derived from Standard Generalized Markup Language (SGML).
• XML was designed to store and transport data.
• There are three important characteristics of XML that make it useful in a
variety of systems and solutions:
• XML is extensible: XML allows you to create your own self-descriptive
tags, or language, that suits your application.
• XML carries the data, does not present it: XML allows you to store the
data irrespective of how it will be presented.
• XML is a public standard: XML was developed by an organization called
the World Wide Web Consortium (W3C) and is available as an open
standard.
•
XML USAGE
• XML can work behind the scene to simplify the creation of HTML
documents for large web sites.
• XML can be used to exchange the information between organizations 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 style sheets to create almost any desired
output.
• Virtually, any type of data can be expressed as an XML document.
XML SYNTAX
• XML Documents Must Have a Root Element
• XML documents must contain one root element that is the parent of all
other elements:
XML
PROLOG
•The XML prolog is optional. If it exists, it must come first in the document.
•XML documents can contain international characters, like Norwegian øæå or
French êèé.
•To avoid errors, you should specify the encoding used, or save your XML files as
UTF-8.
•UTF-8 is the default character encoding for XML documents.
XML SYNTAX(Cont..)
• All XML Elements Must Have a Closing Tag
• In HTML, some elements might work well, even with a missing closing
tag:
• <p>This is a paragraph.
<br>
• In XML, it is illegal to omit the closing tag. All elements must have a
closing tag:
• <p>This is a paragraph.</p>
<br />
• XML tags are case sensitive. The tag <Letter> is different from the tag
<letter>.
• Opening and closing tags must be written with the same case:
XML SYNTAX(Cont..)
• XML Elements Must be Properly Nested
• In HTML, you might see improperly nested elements:
In XML, all elements must be properly nested within each other:
XML SYNTAX(Cont..)
• XML Attribute Values Must be Quoted
• XML elements can have attributes in name/value pairs just like in HTML.
• In XML, the attribute values must always be quoted.
XML DECLARATION
• XML declaration contains details that prepare an XML processor to parse
the XML document. It is optional, but when used, it must appear in first
line of the XML document. <?xml version="version_number"
encoding="encoding_declaration"
standalone="standalone_status" ?>
Parameter Parameter_Value Parameter_Definition
Version 1.0 Specifies the version of the XML standard used.
Encoding UTF-8, UTF-16 It defines the character encoding used in the document. UTF-8
is the default encoding used.
Standalone yes or no. It informs the parser whether the document relies on the
information from an external source, such as external
document type definition (DTD), for its content. The default
value is set to no. Setting it to yes tells the processor there are
no external declarations required for parsing the document.
XML DECLARATION(Cont..)
• 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 and values are case-sensitive.
• The names are always in lower case.
• The order of placing the parameters is important. The correct order
is: version, encoding and standalone.
• Either single or double quotes may be used.
• The XML declaration has no closing tag i.e. </?xml>
XML TAGS
• XML tags form the foundation of XML. They define the scope of an element in the XML.
• They can also be used to insert comments, declare settings required for parsing the
environment and to insert special instructions.
• We can broadly categorize XML tags as follows:
• Start Tag
• The beginning of every non-empty XML element is marked by a start-tag. An example of
start-tag is:
• <address>
• End Tag
• Every element that has a start tag should end with an end-tag. An example of end-tag is:
• </address>Note that the end tags include a solidus ("/") before the name of an element.
• Empty Tag
• The text that appears between start-tag and end-tag is called content. An element which has no
content is termed as empty. An empty element can be represented in two ways as below:
• (1) A start-tag immediately followed by an end-tag as shown below:
• <hr></hr>
• (2) A complete empty-element tag is as shown below:
• <hr />Empty-element tags may be used for any element which has no content.
XMLATTRIBUTES
• Attributes are part of the XML elements. An element can have multiple unique attributes.
Attribute gives more information about XML elements. To be more precise, they define
properties of elements. An XML attribute is always a name-value pair.
• An XML element is everything from (including) the element's start tag to (including) the
element's end tag.
• Syntax
• An XML attribute has following syntax:
<element-name attribute1 attribute2 > ....content.. < /element-name>
•Attributes are used to distinguish among elements of the same name. When
you do not want to create a new element for every situation. Hence, use of an
attribute can add a little more detail in differentiating two or more similar
elements.
where attribute1 and attribute2 has the following form:
name = "value"
value has to be in double (" ") or single (' ') quotes.
Here, attribute1 and attribute2 are unique attribute labels.

More Related Content

What's hot

What's hot (20)

Xml presentation
Xml presentationXml presentation
Xml presentation
 
Xml
XmlXml
Xml
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
XML
XMLXML
XML
 
Xml
XmlXml
Xml
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
XML
XMLXML
XML
 
Xml tutorial
Xml tutorialXml tutorial
Xml tutorial
 
XML
XMLXML
XML
 
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xmlXml theory 2005_[ngohaianh.info]_1_introduction-to-xml
Xml theory 2005_[ngohaianh.info]_1_introduction-to-xml
 
XML
XMLXML
XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml and xml processor
Xml and xml processorXml and xml processor
Xml and xml processor
 
Xml
XmlXml
Xml
 
uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2uptu web technology unit 2 Xml2
uptu web technology unit 2 Xml2
 
XML
XMLXML
XML
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 

Viewers also liked

Viewers also liked (13)

Xml dom
Xml domXml dom
Xml dom
 
Xml schema
Xml schemaXml schema
Xml schema
 
Http request and http response
Http request and http responseHttp request and http response
Http request and http response
 
Dom parser
Dom parserDom parser
Dom parser
 
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...
Quiz app(j tabbed pane,jdialog,container,actionevent,jradiobutton,buttongroup...
 
Xml dtd
Xml dtdXml dtd
Xml dtd
 
Events1
Events1Events1
Events1
 
Xhtml
XhtmlXhtml
Xhtml
 
Jsp elements
Jsp elementsJsp elements
Jsp elements
 
Reading init param
Reading init paramReading init param
Reading init param
 
Jdbc in servlets
Jdbc in servletsJdbc in servlets
Jdbc in servlets
 
Understanding layout managers
Understanding layout managersUnderstanding layout managers
Understanding layout managers
 
Using cookies and sessions
Using cookies and sessionsUsing cookies and sessions
Using cookies and sessions
 

Similar to Intro xml

chapter 4 web authoring unit 4 xml.pptx
chapter 4 web authoring  unit 4 xml.pptxchapter 4 web authoring  unit 4 xml.pptx
chapter 4 web authoring unit 4 xml.pptx
amare63
 

Similar to Intro xml (20)

WT UNIT-2 XML.pdf
WT UNIT-2 XML.pdfWT UNIT-2 XML.pdf
WT UNIT-2 XML.pdf
 
Web Technology Part 4
Web Technology Part 4Web Technology Part 4
Web Technology Part 4
 
Ch2 neworder
Ch2 neworderCh2 neworder
Ch2 neworder
 
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5   XMLM.FLORENCE DAYANA WEB DESIGN -Unit 5   XML
M.FLORENCE DAYANA WEB DESIGN -Unit 5 XML
 
chapter 4 web authoring unit 4 xml.pptx
chapter 4 web authoring  unit 4 xml.pptxchapter 4 web authoring  unit 4 xml.pptx
chapter 4 web authoring unit 4 xml.pptx
 
Xhtml
XhtmlXhtml
Xhtml
 
XML - Extensible Markup Language for Network Security.pptx
XML - Extensible Markup Language for Network Security.pptxXML - Extensible Markup Language for Network Security.pptx
XML - Extensible Markup Language for Network Security.pptx
 
Xml passing in java
Xml passing in javaXml passing in java
Xml passing in java
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 
XML and Localization
XML and LocalizationXML and Localization
XML and Localization
 
Xml basics
Xml basicsXml basics
Xml basics
 
Introduction to XML.ppt
Introduction to XML.pptIntroduction to XML.ppt
Introduction to XML.ppt
 
Introduction to XML.ppt
Introduction to XML.pptIntroduction to XML.ppt
Introduction to XML.ppt
 
Xml
XmlXml
Xml
 
Xml 1
Xml 1Xml 1
Xml 1
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
xml introduction in web technologies subject
xml introduction in web technologies subjectxml introduction in web technologies subject
xml introduction in web technologies subject
 
xml.pptx
xml.pptxxml.pptx
xml.pptx
 

More from sana mateen

More from sana mateen (20)

Files
FilesFiles
Files
 
PHP Variables and scopes
PHP Variables and scopesPHP Variables and scopes
PHP Variables and scopes
 
Php intro
Php introPhp intro
Php intro
 
Php and web forms
Php and web formsPhp and web forms
Php and web forms
 
Mail
MailMail
Mail
 
Files in php
Files in phpFiles in php
Files in php
 
File upload php
File upload phpFile upload php
File upload php
 
Regex posix
Regex posixRegex posix
Regex posix
 
Encryption in php
Encryption in phpEncryption in php
Encryption in php
 
Authentication methods
Authentication methodsAuthentication methods
Authentication methods
 
Unit 1-subroutines in perl
Unit 1-subroutines in perlUnit 1-subroutines in perl
Unit 1-subroutines in perl
 
Unit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scriptingUnit 1-uses for scripting languages,web scripting
Unit 1-uses for scripting languages,web scripting
 
Unit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressionsUnit 1-strings,patterns and regular expressions
Unit 1-strings,patterns and regular expressions
 
Unit 1-scalar expressions and control structures
Unit 1-scalar expressions and control structuresUnit 1-scalar expressions and control structures
Unit 1-scalar expressions and control structures
 
Unit 1-perl names values and variables
Unit 1-perl names values and variablesUnit 1-perl names values and variables
Unit 1-perl names values and variables
 
Unit 1-introduction to scripts
Unit 1-introduction to scriptsUnit 1-introduction to scripts
Unit 1-introduction to scripts
 
Unit 1-introduction to perl
Unit 1-introduction to perlUnit 1-introduction to perl
Unit 1-introduction to perl
 
Unit 1-array,lists and hashes
Unit 1-array,lists and hashesUnit 1-array,lists and hashes
Unit 1-array,lists and hashes
 
Uses for scripting languages,web scripting in perl
Uses for scripting languages,web scripting in perlUses for scripting languages,web scripting in perl
Uses for scripting languages,web scripting in perl
 
Scalar expressions and control structures in perl
Scalar expressions and control structures in perlScalar expressions and control structures in perl
Scalar expressions and control structures in perl
 

Recently uploaded

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 

Recently uploaded (20)

Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 

Intro xml

  • 2. INTRODUCTION • XML stands for Extensible Markup Language and is a text-based markup language derived from Standard Generalized Markup Language (SGML). • XML was designed to store and transport data. • There are three important characteristics of XML that make it useful in a variety of systems and solutions: • XML is extensible: XML allows you to create your own self-descriptive tags, or language, that suits your application. • XML carries the data, does not present it: XML allows you to store the data irrespective of how it will be presented. • XML is a public standard: XML was developed by an organization called the World Wide Web Consortium (W3C) and is available as an open standard. •
  • 3. XML USAGE • XML can work behind the scene to simplify the creation of HTML documents for large web sites. • XML can be used to exchange the information between organizations 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 style sheets to create almost any desired output. • Virtually, any type of data can be expressed as an XML document.
  • 4. XML SYNTAX • XML Documents Must Have a Root Element • XML documents must contain one root element that is the parent of all other elements: XML PROLOG •The XML prolog is optional. If it exists, it must come first in the document. •XML documents can contain international characters, like Norwegian øæå or French êèé. •To avoid errors, you should specify the encoding used, or save your XML files as UTF-8. •UTF-8 is the default character encoding for XML documents.
  • 5. XML SYNTAX(Cont..) • All XML Elements Must Have a Closing Tag • In HTML, some elements might work well, even with a missing closing tag: • <p>This is a paragraph. <br> • In XML, it is illegal to omit the closing tag. All elements must have a closing tag: • <p>This is a paragraph.</p> <br /> • XML tags are case sensitive. The tag <Letter> is different from the tag <letter>. • Opening and closing tags must be written with the same case:
  • 6. XML SYNTAX(Cont..) • XML Elements Must be Properly Nested • In HTML, you might see improperly nested elements: In XML, all elements must be properly nested within each other:
  • 7. XML SYNTAX(Cont..) • XML Attribute Values Must be Quoted • XML elements can have attributes in name/value pairs just like in HTML. • In XML, the attribute values must always be quoted.
  • 8. XML DECLARATION • XML declaration contains details that prepare an XML processor to parse the XML document. It is optional, but when used, it must appear in first line of the XML document. <?xml version="version_number" encoding="encoding_declaration" standalone="standalone_status" ?> Parameter Parameter_Value Parameter_Definition Version 1.0 Specifies the version of the XML standard used. Encoding UTF-8, UTF-16 It defines the character encoding used in the document. UTF-8 is the default encoding used. Standalone yes or no. It informs the parser whether the document relies on the information from an external source, such as external document type definition (DTD), for its content. The default value is set to no. Setting it to yes tells the processor there are no external declarations required for parsing the document.
  • 9. XML DECLARATION(Cont..) • 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 and values are case-sensitive. • The names are always in lower case. • The order of placing the parameters is important. The correct order is: version, encoding and standalone. • Either single or double quotes may be used. • The XML declaration has no closing tag i.e. </?xml>
  • 10. XML TAGS • XML tags form the foundation of XML. They define the scope of an element in the XML. • They can also be used to insert comments, declare settings required for parsing the environment and to insert special instructions. • We can broadly categorize XML tags as follows: • Start Tag • The beginning of every non-empty XML element is marked by a start-tag. An example of start-tag is: • <address> • End Tag • Every element that has a start tag should end with an end-tag. An example of end-tag is: • </address>Note that the end tags include a solidus ("/") before the name of an element. • Empty Tag • The text that appears between start-tag and end-tag is called content. An element which has no content is termed as empty. An empty element can be represented in two ways as below: • (1) A start-tag immediately followed by an end-tag as shown below: • <hr></hr> • (2) A complete empty-element tag is as shown below: • <hr />Empty-element tags may be used for any element which has no content.
  • 11. XMLATTRIBUTES • Attributes are part of the XML elements. An element can have multiple unique attributes. Attribute gives more information about XML elements. To be more precise, they define properties of elements. An XML attribute is always a name-value pair. • An XML element is everything from (including) the element's start tag to (including) the element's end tag. • Syntax • An XML attribute has following syntax: <element-name attribute1 attribute2 > ....content.. < /element-name> •Attributes are used to distinguish among elements of the same name. When you do not want to create a new element for every situation. Hence, use of an attribute can add a little more detail in differentiating two or more similar elements. where attribute1 and attribute2 has the following form: name = "value" value has to be in double (" ") or single (' ') quotes. Here, attribute1 and attribute2 are unique attribute labels.