SlideShare a Scribd company logo
1 of 57
XML Mukesh N Tekwani tekwani@email.com www.myexamnotes.com
Disadvantages of HTML – Need for XML ,[object Object]
HTML lacks structure
HTML is not suitable for data interchange
HTML is not context aware – HTML does not allow us to describe the information content or the semantics of the document
HTML is not object-oriented
HTML is not re-usable
HTML is not extensible,[object Object]
Extensible – capable of being extended
Markup – it is a way of adding information to the text indicating the logical components of a document
How is it different from HTML?
HTML was designed to display data
XML was designed to store, describe and transport data
XML is also a markup language like HTML
XML tags are not predefined – we must design our own tags.,[object Object]
Advantages (Features) of XML - 1 XML simplifies data sharing Since XML data is stored in plain text format, data can be easily shared among different hardware and software platforms. XML separates data from HTML To display dynamic data in HTML, the code must be rewritten each time the data changes. With XML, data can be stored in separate files so that whenever the data changes it is automatically displayed correctly. We have to design the HTML for layout only once.
Advantages (Features) of XML - 2 ,[object Object]
With XML, data can be easily exchanged between different platforms.
XML makes data more available
Since XML is independent of hardware, software and application, XML can make your data more available and useful.
Different applications can access your data in HTML pages
XML provides a means to package almost any type of information (binary, text, voice, video) for delivery to a receiving end.,[object Object]
Applications of XML File Converters Many applications have been written to convert existing documents into the XML standard. An example is a PDF to XML converter.  Cell Phones - XML data is sent to some cell phones. This data is then formatted to display text or images, and even to play sounds! VoiceXML - Converts XML documents into an audio format so that you can listen to an XML document.
XML Document – Example 1 <?xml version="1.0" encoding="ISO-8859-1"?> <class_list> <student> <name>Anamika</name> <grade>A+</grade> </student> <student> <name>Veena</name> <grade>B+</grade> </student> </class_list>
XML Document–Example 1 - Explained ,[object Object]
<?xml version="1.0" encoding="ISO-8859-1"?>
It defines the XML version (1.0)
It gives the encoding used (ISO-8859-1 = Latin-1/West European character set)
The XML declaration is actually a processing instruction (PI) an it is identified by the ? At its start and end
The next line describes the root element of the document (like saying: "this document is a class_list“)
The next 2 lines describe 2 child elements of the root (student, name, and grade)
And finally the last line defines the end of the root element: </class_list>,[object Object]
Tree structure ,[object Object]
XML documents must contain a root element. This element is "the parent" of all other elements.
The elements in an XML document form a document tree. The tree starts at the root and branches to the lowest level of the tree.
All elements can have sub elements (child elements)
<root>	<child>		<subchild>.....</subchild>	</child></root,[object Object]
XML – Example 2 <bookstore> 	<book category = "COOKING">	<title lang = "en">Everyday Italian</title>	<author>Giada De Laurentiis</author>	<year>2005</year>	<price>30.00</price></book> 	<book category = "CHILDREN">	<title lang = "en">Harry Potter</title>	<author>J K. Rowling</author>	<year>2005</year>	<price>29.99</price></book> 	<book category = "WEB">	<title lang = "en">Learning XML</title>	<author>Erik T. Ray</author>	<year>2003</year>	<price>39.95</price></book> </bookstore>
Important Definitions XML Element An element is a start tag, content, and an end tag. E.g.,  <greeting>”Hello World</greeting>  XML Attribute An attribute provides additional information about elements E.g., <note priority = “high”>
Important Definitions Child elements – XML elements may have child elements <employee id = “100”> 	<name> 		<first>Anita</first> 		<initial>D</initial> 		<last>Singh</last>		 	</name> </employee> Parent Element Name Children of parent element
XML Element An XML element is everything from the element's start tag to the element's end tag. An element can contain other elements, simple text or a mixture of both.  Elements can also have attributes.
XML Syntax Rules All XML elements must have a closing tag XML tags are case sensitive.  The tag <Book> is different from the tag <book> Opening and closing tags must be written with the same case 	<Message>This is incorrect</message><message>This is correct</message>
XML Syntax Rules ,[object Object]
HTML permits this:<B><I>This text is bold and italic</B></I> 	But in XML this is invalid. All elements must be properly nested within one another. <B><I>This text is bold and italic</I></B> ,[object Object],<root> 	<child>	<subchild>.....</subchild></child> </root>
XML Syntax Rules XML Entity References Some characters have a special meaning in XML. E.g., If you place a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element. <message>if salary < 1000 then </message> To avoid this error, replace the "<" character with an entity reference: <message>if salary &lt; 1000 then</message>
XML Syntax Rules XML Entity References There are 5 predefined entity references in XML:
XML Syntax Rules ,[object Object],	<!-- This is a comment -->  ,[object Object]
XML Naming Rules
Names can contain letters, numbers, and other characters
Names cannot start with a number or punctuation character
Names cannot start with the letters xml (or XML, or Xml, etc)
Names cannot contain spaces
Any name can be used, no words are reserved.,[object Object]
Different Types of XML Markups 5 Types of Markup in XML Elements Entities Comments Processing Instructions Ignored Sections
Element Markup Element Markup It is composed of 3 parts: start tag, the content, and the end tag. Example:  <name>Neetu</name> The start tag and the end tag can be treated as wrappers The element name that appears in the start tag must be exactly the same as the name that appears in the end tag. Example:  <Name>Neetu</name>
Different Types of XML Markups Attribute Markup Attributes are used to attach information to the information contained in an element. General syntax for attributes is: <elementname property = ‘value’> 			Or <elementname property = “value”> Attribute value must be enclosed within quotation marks Use either single quotes or double quotes but don’t mix them.
Attribute Markup If we specify the attributes for the same element more than once, the specifications are merged. <?xml version = “1.0”?> <myparas> <para num = “first”>This is Para 1 </para> <para num = ‘second’ color = “red”>This is Para 2</para> <myparas>

More Related Content

What's hot (20)

Beginners css tutorial for web designers
Beginners css tutorial for web designersBeginners css tutorial for web designers
Beginners css tutorial for web designers
 
Xml presentation
Xml presentationXml presentation
Xml presentation
 
PPT on Basic HTML Tags
PPT on Basic HTML TagsPPT on Basic HTML Tags
PPT on Basic HTML Tags
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Html basics
Html basicsHtml basics
Html basics
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Html
HtmlHtml
Html
 
html5.ppt
html5.ppthtml5.ppt
html5.ppt
 
Html Slide Part-1
Html Slide Part-1Html Slide Part-1
Html Slide Part-1
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
Dtd
DtdDtd
Dtd
 
Html ppt computer
Html ppt computerHtml ppt computer
Html ppt computer
 
Cascading style sheets (CSS)
Cascading style sheets (CSS)Cascading style sheets (CSS)
Cascading style sheets (CSS)
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
Html and css
Html and cssHtml and css
Html and css
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Cascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) helpCascading Style Sheets (CSS) help
Cascading Style Sheets (CSS) help
 
Web html table tags
Web html  table tagsWeb html  table tags
Web html table tags
 
Tags in html
Tags in htmlTags in html
Tags in html
 

Viewers also liked

Viewers also liked (20)

Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
XML, DTD & XSD Overview
XML, DTD & XSD OverviewXML, DTD & XSD Overview
XML, DTD & XSD Overview
 
Xml
XmlXml
Xml
 
Xml ppt
Xml pptXml ppt
Xml ppt
 
Introduction to xml
Introduction to xmlIntroduction to xml
Introduction to xml
 
Xml
XmlXml
Xml
 
Lecture #2 xml
Lecture #2 xmlLecture #2 xml
Lecture #2 xml
 
XML | Computer Science
XML | Computer ScienceXML | Computer Science
XML | Computer Science
 
XML.ppt
XML.pptXML.ppt
XML.ppt
 
Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)Java API for XML Web Services (JAX-WS)
Java API for XML Web Services (JAX-WS)
 
10. XML in DBMS
10. XML in DBMS10. XML in DBMS
10. XML in DBMS
 
Intro xml
Intro xmlIntro xml
Intro xml
 
Xml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelXml Publisher And Reporting To Excel
Xml Publisher And Reporting To Excel
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
Xml Session No 1
Xml Session No 1Xml Session No 1
Xml Session No 1
 
XML - EXtensible Markup Language
XML - EXtensible Markup LanguageXML - EXtensible Markup Language
XML - EXtensible Markup Language
 
XML
XMLXML
XML
 
Dtd
DtdDtd
Dtd
 
Basic xml syntax
Basic xml syntaxBasic xml syntax
Basic xml syntax
 
Session 1
Session 1Session 1
Session 1
 

Similar to XML (20)

Xmlphp
XmlphpXmlphp
Xmlphp
 
Week1 xml
Week1 xmlWeek1 xml
Week1 xml
 
Xml 1
Xml 1Xml 1
Xml 1
 
About XML
About XMLAbout XML
About XML
 
Xml tutorial
Xml tutorialXml tutorial
Xml tutorial
 
Xml
XmlXml
Xml
 
Web 130 XML Podcast
Web 130 XML PodcastWeb 130 XML Podcast
Web 130 XML Podcast
 
Xml description
Xml descriptionXml description
Xml description
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
xml introduction in web technologies subject
xml introduction in web technologies subjectxml introduction in web technologies subject
xml introduction in web technologies subject
 
Xml 150323102007-conversion-gate01
Xml 150323102007-conversion-gate01Xml 150323102007-conversion-gate01
Xml 150323102007-conversion-gate01
 
Xml material
Xml materialXml material
Xml material
 
Xml material
Xml materialXml material
Xml material
 
Xml material
Xml materialXml material
Xml material
 
Xml
XmlXml
Xml
 
XML DTD Validate
XML DTD ValidateXML DTD Validate
XML DTD Validate
 
PHP XML
PHP XMLPHP XML
PHP XML
 
Lotusphere 2006 AD212 Introduction to DXL
Lotusphere 2006 AD212 Introduction to DXLLotusphere 2006 AD212 Introduction to DXL
Lotusphere 2006 AD212 Introduction to DXL
 
Xml
XmlXml
Xml
 
Xml
XmlXml
Xml
 

More from Mukesh Tekwani

Computer Science Made Easy - Youtube Channel
Computer Science Made Easy - Youtube ChannelComputer Science Made Easy - Youtube Channel
Computer Science Made Easy - Youtube ChannelMukesh Tekwani
 
The Elphinstonian 1988-College Building Centenary Number (2).pdf
The Elphinstonian 1988-College Building Centenary Number (2).pdfThe Elphinstonian 1988-College Building Centenary Number (2).pdf
The Elphinstonian 1988-College Building Centenary Number (2).pdfMukesh Tekwani
 
ISCE-Class 12-Question Bank - Electrostatics - Physics
ISCE-Class 12-Question Bank - Electrostatics  -  PhysicsISCE-Class 12-Question Bank - Electrostatics  -  Physics
ISCE-Class 12-Question Bank - Electrostatics - PhysicsMukesh Tekwani
 
Hexadecimal to binary conversion
Hexadecimal to binary conversion Hexadecimal to binary conversion
Hexadecimal to binary conversion Mukesh Tekwani
 
Hexadecimal to decimal conversion
Hexadecimal to decimal conversion Hexadecimal to decimal conversion
Hexadecimal to decimal conversion Mukesh Tekwani
 
Hexadecimal to octal conversion
Hexadecimal to octal conversionHexadecimal to octal conversion
Hexadecimal to octal conversionMukesh Tekwani
 
Gray code to binary conversion
Gray code to binary conversion Gray code to binary conversion
Gray code to binary conversion Mukesh Tekwani
 
Decimal to Binary conversion
Decimal to Binary conversionDecimal to Binary conversion
Decimal to Binary conversionMukesh Tekwani
 
Video Lectures for IGCSE Physics 2020-21
Video Lectures for IGCSE Physics 2020-21Video Lectures for IGCSE Physics 2020-21
Video Lectures for IGCSE Physics 2020-21Mukesh Tekwani
 
Refraction and dispersion of light through a prism
Refraction and dispersion of light through a prismRefraction and dispersion of light through a prism
Refraction and dispersion of light through a prismMukesh Tekwani
 
Refraction of light at a plane surface
Refraction of light at a plane surfaceRefraction of light at a plane surface
Refraction of light at a plane surfaceMukesh Tekwani
 
Atom, origin of spectra Bohr's theory of hydrogen atom
Atom, origin of spectra Bohr's theory of hydrogen atomAtom, origin of spectra Bohr's theory of hydrogen atom
Atom, origin of spectra Bohr's theory of hydrogen atomMukesh Tekwani
 
Refraction of light at spherical surfaces of lenses
Refraction of light at spherical surfaces of lensesRefraction of light at spherical surfaces of lenses
Refraction of light at spherical surfaces of lensesMukesh Tekwani
 
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGEISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGEMukesh Tekwani
 

More from Mukesh Tekwani (20)

Computer Science Made Easy - Youtube Channel
Computer Science Made Easy - Youtube ChannelComputer Science Made Easy - Youtube Channel
Computer Science Made Easy - Youtube Channel
 
The Elphinstonian 1988-College Building Centenary Number (2).pdf
The Elphinstonian 1988-College Building Centenary Number (2).pdfThe Elphinstonian 1988-College Building Centenary Number (2).pdf
The Elphinstonian 1988-College Building Centenary Number (2).pdf
 
Circular motion
Circular motionCircular motion
Circular motion
 
Gravitation
GravitationGravitation
Gravitation
 
ISCE-Class 12-Question Bank - Electrostatics - Physics
ISCE-Class 12-Question Bank - Electrostatics  -  PhysicsISCE-Class 12-Question Bank - Electrostatics  -  Physics
ISCE-Class 12-Question Bank - Electrostatics - Physics
 
Hexadecimal to binary conversion
Hexadecimal to binary conversion Hexadecimal to binary conversion
Hexadecimal to binary conversion
 
Hexadecimal to decimal conversion
Hexadecimal to decimal conversion Hexadecimal to decimal conversion
Hexadecimal to decimal conversion
 
Hexadecimal to octal conversion
Hexadecimal to octal conversionHexadecimal to octal conversion
Hexadecimal to octal conversion
 
Gray code to binary conversion
Gray code to binary conversion Gray code to binary conversion
Gray code to binary conversion
 
What is Gray Code?
What is Gray Code? What is Gray Code?
What is Gray Code?
 
Decimal to Binary conversion
Decimal to Binary conversionDecimal to Binary conversion
Decimal to Binary conversion
 
Video Lectures for IGCSE Physics 2020-21
Video Lectures for IGCSE Physics 2020-21Video Lectures for IGCSE Physics 2020-21
Video Lectures for IGCSE Physics 2020-21
 
Refraction and dispersion of light through a prism
Refraction and dispersion of light through a prismRefraction and dispersion of light through a prism
Refraction and dispersion of light through a prism
 
Refraction of light at a plane surface
Refraction of light at a plane surfaceRefraction of light at a plane surface
Refraction of light at a plane surface
 
Spherical mirrors
Spherical mirrorsSpherical mirrors
Spherical mirrors
 
Atom, origin of spectra Bohr's theory of hydrogen atom
Atom, origin of spectra Bohr's theory of hydrogen atomAtom, origin of spectra Bohr's theory of hydrogen atom
Atom, origin of spectra Bohr's theory of hydrogen atom
 
Refraction of light at spherical surfaces of lenses
Refraction of light at spherical surfaces of lensesRefraction of light at spherical surfaces of lenses
Refraction of light at spherical surfaces of lenses
 
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGEISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
ISCE (XII) - PHYSICS BOARD EXAM FEB 2020 - WEIGHTAGE
 
Cyber Laws
Cyber LawsCyber Laws
Cyber Laws
 
XML
XMLXML
XML
 

Recently uploaded

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 

Recently uploaded (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 

XML

  • 1. XML Mukesh N Tekwani tekwani@email.com www.myexamnotes.com
  • 2.
  • 4. HTML is not suitable for data interchange
  • 5. HTML is not context aware – HTML does not allow us to describe the information content or the semantics of the document
  • 6. HTML is not object-oriented
  • 7. HTML is not re-usable
  • 8.
  • 9. Extensible – capable of being extended
  • 10. Markup – it is a way of adding information to the text indicating the logical components of a document
  • 11. How is it different from HTML?
  • 12. HTML was designed to display data
  • 13. XML was designed to store, describe and transport data
  • 14. XML is also a markup language like HTML
  • 15.
  • 16. Advantages (Features) of XML - 1 XML simplifies data sharing Since XML data is stored in plain text format, data can be easily shared among different hardware and software platforms. XML separates data from HTML To display dynamic data in HTML, the code must be rewritten each time the data changes. With XML, data can be stored in separate files so that whenever the data changes it is automatically displayed correctly. We have to design the HTML for layout only once.
  • 17.
  • 18. With XML, data can be easily exchanged between different platforms.
  • 19. XML makes data more available
  • 20. Since XML is independent of hardware, software and application, XML can make your data more available and useful.
  • 21. Different applications can access your data in HTML pages
  • 22.
  • 23. Applications of XML File Converters Many applications have been written to convert existing documents into the XML standard. An example is a PDF to XML converter. Cell Phones - XML data is sent to some cell phones. This data is then formatted to display text or images, and even to play sounds! VoiceXML - Converts XML documents into an audio format so that you can listen to an XML document.
  • 24. XML Document – Example 1 <?xml version="1.0" encoding="ISO-8859-1"?> <class_list> <student> <name>Anamika</name> <grade>A+</grade> </student> <student> <name>Veena</name> <grade>B+</grade> </student> </class_list>
  • 25.
  • 27. It defines the XML version (1.0)
  • 28. It gives the encoding used (ISO-8859-1 = Latin-1/West European character set)
  • 29. The XML declaration is actually a processing instruction (PI) an it is identified by the ? At its start and end
  • 30. The next line describes the root element of the document (like saying: "this document is a class_list“)
  • 31. The next 2 lines describe 2 child elements of the root (student, name, and grade)
  • 32.
  • 33.
  • 34. XML documents must contain a root element. This element is "the parent" of all other elements.
  • 35. The elements in an XML document form a document tree. The tree starts at the root and branches to the lowest level of the tree.
  • 36. All elements can have sub elements (child elements)
  • 37.
  • 38. XML – Example 2 <bookstore> <book category = "COOKING"> <title lang = "en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price></book> <book category = "CHILDREN"> <title lang = "en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price></book> <book category = "WEB"> <title lang = "en">Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price></book> </bookstore>
  • 39. Important Definitions XML Element An element is a start tag, content, and an end tag. E.g., <greeting>”Hello World</greeting> XML Attribute An attribute provides additional information about elements E.g., <note priority = “high”>
  • 40. Important Definitions Child elements – XML elements may have child elements <employee id = “100”> <name> <first>Anita</first> <initial>D</initial> <last>Singh</last> </name> </employee> Parent Element Name Children of parent element
  • 41. XML Element An XML element is everything from the element's start tag to the element's end tag. An element can contain other elements, simple text or a mixture of both. Elements can also have attributes.
  • 42. XML Syntax Rules All XML elements must have a closing tag XML tags are case sensitive. The tag <Book> is different from the tag <book> Opening and closing tags must be written with the same case <Message>This is incorrect</message><message>This is correct</message>
  • 43.
  • 44.
  • 45. XML Syntax Rules XML Entity References Some characters have a special meaning in XML. E.g., If you place a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element. <message>if salary < 1000 then </message> To avoid this error, replace the "<" character with an entity reference: <message>if salary &lt; 1000 then</message>
  • 46. XML Syntax Rules XML Entity References There are 5 predefined entity references in XML:
  • 47.
  • 49. Names can contain letters, numbers, and other characters
  • 50. Names cannot start with a number or punctuation character
  • 51. Names cannot start with the letters xml (or XML, or Xml, etc)
  • 53.
  • 54. Different Types of XML Markups 5 Types of Markup in XML Elements Entities Comments Processing Instructions Ignored Sections
  • 55. Element Markup Element Markup It is composed of 3 parts: start tag, the content, and the end tag. Example: <name>Neetu</name> The start tag and the end tag can be treated as wrappers The element name that appears in the start tag must be exactly the same as the name that appears in the end tag. Example: <Name>Neetu</name>
  • 56. Different Types of XML Markups Attribute Markup Attributes are used to attach information to the information contained in an element. General syntax for attributes is: <elementname property = ‘value’> Or <elementname property = “value”> Attribute value must be enclosed within quotation marks Use either single quotes or double quotes but don’t mix them.
  • 57. Attribute Markup If we specify the attributes for the same element more than once, the specifications are merged. <?xml version = “1.0”?> <myparas> <para num = “first”>This is Para 1 </para> <para num = ‘second’ color = “red”>This is Para 2</para> <myparas>
  • 58. Attribute Markup When the XML processor encounters line 3, it will record the fact that para element has the num attribute When it encounters the 4th line it will record the fact that para element has the color attribute
  • 59. Reserved Attribute The xml:lang attribute is reserved to identify the human language in which the element was written The value of attribute is one of the following: en English fr French de German
  • 60.
  • 61. Similar to attributes in HTML e.g., <IMG SRC=“sky.jpg”> In this SRC is the attribute
  • 62. XML Attribute values must be quoted
  • 63. XML elements can have attributes in name/value pairs just like in HTML.
  • 64. In XML the attribute value must always be quoted.<note date = 01/01/2010> <---------- This is invalid<to>Priya</to><from>Deeali</from> </note> <note date = “01/01/2010”> --------- Now OK since enclosed in double quotes <note date = ‘01/01/2010’> --------- This is also OK since enclosed in single quotes
  • 65. XML Attributes and Elements Consider the following example: <person gender = "female"> <firstname>Geeta</firstname> <lastname>Shah</lastname></person> Gender is an attribute Gender is an element <person> <gender>female</gender> <firstname>Geeta</firstname> <lastname>Shah</lastname></person>
  • 66.
  • 67. Attributes cannot contain tree structures
  • 68. Attributes are not easily expandable (for future changes)
  • 69. Attributes are difficult to read and maintain
  • 71.
  • 72.
  • 73. Metadata – data about data – should be stored as attributes
  • 74. The ID can then be used to identify the XML element <messages><note id="501"> <to>Tina</to> <from>Yasmin</from> <heading>Reminder</heading> <body>Happy Birthday!</body></note><note id="502"> <to>Yasmin</to> <from>Tina</from> <heading>Re: Reminder</heading> <body>Thank you, my dear</body></note></messages>
  • 75.
  • 76. What does Extensible mean in XML? Now suppose the author of the XML document added some extra information to it: <note><date>2008-01-10</date><to>Anita</to><from>Veena</from><heading>Reminder</heading><body>You have an exam tomorrow</body> </note>
  • 77. What does Extensible mean in XML? This application will not crash because it will still find the <to>, <from> and <body> elements in the XML document and produce the same output.
  • 78. XML Validation What is a “well formed” XML document? XML with correct syntax is "Well Formed" XML. A "Well Formed" XML document has correct XML syntax. XML documents must have a root element XML elements must have a closing tag XML tags are case sensitive XML elements must be properly nested XML attribute values must be quoted
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84. These examples are invalid since they are both examples forgetting the semi-colon following the character entity. Bad Examples… <h1>Jack &amp Jill</h1> <equation>5 &lt 2</equation>
  • 85. Good Examples… <h1>Jack &amp; Jill</h1> <equation>5 &lt; 2</equation>
  • 86.
  • 87. Element names may contain letters, numbers, hyphens, periods and underscores inclusively.BAD EXAMPLES <bad*characters> <illegal space> <99number-start> GOOD EXAMPLES <example-one> <_example2> <Example.Three>
  • 88.
  • 89.
  • 90.
  • 91. Viewing XML Files - 2 The XML document will be displayed with color-coded root and child elements. A plus (+) or minus sign (-) to the left of the elements can be clicked to expand or collapse the element structure.  To view the raw XML source (without the + and - signs), select "View Page Source" or "View Source" from the browser menu.
  • 92. Viewing XML Files - 3 Why XML documents display like this? XML documents do not carry information about how to display the data. Since XML tags are created by the user of the XML document, browsers do not know if a tag like <table> describes an HTML table or a dining table. Without any information about how to display the data, most browsers will just display the XML document as it is.
  • 93. Using CSS to display XML Files CSS (Cascading Style Sheets) can be used to format a XML document. Consider this XML document:
  • 94. Displaying Formatted XML document-1 <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type = "text/css" href = "birthdate.css"?> <birthdate> <person> <name> <first>Anokhi</first> <last>Parikh</last> </name> <date> <month>01</month> <day>21</day> <year>1992</year> </date> </person> </birthdate>
  • 95. Displaying Formatted XML document-2 Stylesheet – birthdate.css birthdate { background-color: #ffffff; width: 100%; } person { margin-left: 0; } name { color: #FF0000; font-size: 20pt; } month, day, year { display:block; color: #000000; margin-left: 20pt; }
  • 97.
  • 98. An XSL style sheet is a file that describes how to display an XML document
  • 99. XSL contains a transformation language for XML documents: XSLT. XSLT is used for generating HTML web pages from XML data.
  • 101. XSLT is used to transform an XML document into an HTML document
  • 102. XSLT is the recommended style sheet language for XML