SlideShare une entreprise Scribd logo
1  sur  24
XML
Anjali g
anjalig2009@gmail.com
www.facebook.com/AnjaliG
eetha
twitter.com/AnjaliGeetha
in.linkedin.com/in/Anjali G
9497879952
MAIN POINTS
• What is XML
• Difference between XML and HTML
• How to use XML
• XML tree
• XML syntax
• XML elements and attributes
• Us e of xml
What is XML?
• XML stands for Extensible Markup Language
• XML is a markup language much like HTML
• XML was designed to carry data, not to display data
• XML tags are not predefined. You must define your own tags
• XML is designed to be self-descriptive
• XML is a W3C Recommendation
Difference Between XML and HTML
 XML was designed to transport and store data, with focus on what data is
 HTML was designed to display data, with focus on how data looks
*HTML is about displaying information, while XML is about carrying information.
XML Does Not DO Anything!!
 Eg:-
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
- It has sender and receiver information
- This XML document does not DO anything -- information wrapped in tags.
Our Own Tags
• XML allows the author to define his/her own tags and his/her own document
structure.
• Eg:- <to> and <from> in above example.
XML is Not a Replacement for HTML
• XML is a software- and hardware-independent tool for carrying information.
• XML is used to transport data, while HTML is used to format and display the
data.
W3C Recommendation
 XML became a W3C Recommendation on February 10, 1998.
• XML is now as important for the Web as HTML was to the foundation
of the Web.
• XML is the most common tool for data transmissions between all sorts
of applications.
XML Separates Data from HTML
• to display dynamic data in your HTML document, it will take a lot of work to edit
the HTML each time the data changes.
• With XML, data can be stored in separate XML files.
 XML Simplifies Data Sharing
• XML data is stored in plain text format. This provides a software- and hardware-
independent way of storing data
 XML Simplifies Data Transport
• One of the most time-consuming challenges for developers is to exchange data
between incompatible systems over the Internet.
• Exchanging data as XML greatly reduces this complexity
XML Simplifies Platform Changes
• Upgrading to new systems (hardware or software platforms), is always time
consuming and large amounts of data must be converted and incompatible data is
often lost..
• XML data is stored in text format. This makes it easier to expand or upgrade to
new operating systems, new applications, or new browsers, without losing data.
 XML Makes Your Data More Available
• Different applications can access your data, not only in HTML pages, but also from
XML data sources.
 XML is Used to Create New Internet Languages
• XHTML
• WSDL for describing available web services
• WAP and WML as markup languages for handheld devices
• RSS languages for news feeds
• RDF and OWL for describing resources and ontology
• SMIL for describing multimedia for the web
XML Tree
• XML documents form a tree structure that starts at "the root" and branches to
"the leaves".
 Eg: <?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
- first line defines the XML version (1.0) and the encoding used (ISO-8859-1 = Latin-
1/West European character set).
- The next line describes the root element of the document
- The next 4 lines describe 4 child elements of the root
- finally the last line defines the end of the root element
Example:
• <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>
• The root element in the example is <bookstore>. All <book> elements in the document are
contained within <bookstore>.
• The <book> element has 4 children: <title>,< author>, <year>, <price>.
XML Syntax Rules
 All XML Elements Must Have a Closing Tag
<p>This is a paragraph.
<br>
<p>This is a paragraph.</p>
<br />
• Note: You might have noticed from the previous example that the XML declaration
did not have a closing tag. This is not an error. The declaration is not a part of the
XML document itself, and it has no closing tag.
 XML Tags are Case Sensitive
• The tag <Letter> is different from the tag <letter>
 XML Elements Must be Properly Nested
• <b><i>This text is bold and italic</i></b>
 XML Documents Must Have a Root Element
• <root>
<child>
<subchild>.....</subchild>
</child>
</root>
• XML attribute values must be quoted
• Eg: <note date="12/11/2007">
<to>Tove</to>
<from>Jani</from>
</note>
• Entity References
<message>if salary < 1000 then</message>
<message>if salary &lt; 1000 then</message>
&lt; < less than
&gt; > greater than
&amp; & ampersand
&apos; ' apostrophe
&quot; " quotation mark
Comments in XML
• similar to that of HTML
- <!-- This is a comment -->
White-space is Preserved in XML
HTML:Hello Tove
Output:Hello Tove
• With XML, the white-space in a document is not truncated.
XML Stores New Line as LF
• In Windows applications, a new line is normally stored as a pair of characters:
carriage return (CR) and line feed (LF)
• XML stores a new line as LF.
XML Elements
• An XML element is everything from the element's start tag to the element's end
tag.
An element can contain:
• other elements
• text
• attributes
• or a mix of all of the above
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
Best Naming Practices
• Make names descriptive. Names with an underscore separator are nice:
<first_name>
• Names should be short and simple
• Avoid "-" characters
• Avoid "." characters
• Avoid ":" characters
XML Elements are Extensible
• XML elements can be extended to carry more information.
XML Attributes
• Attributes provide additional information about an element.
Eg: <img src="computer.gif">
<a href="demo.asp">
• Attribute values must always be quoted
Eg:<person sex="female">
XML Elements vs. Attributes
Attribute:
• <note date="10/01/2008">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
Element:
• <note>
<date>10/01/2008</date>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
Problems with Attributes
• attributes cannot contain multiple values (elements can)
• attributes cannot contain tree structures (elements can)
• attributes are not easily expandable (for future changes)
XML Validation
• XML validated against a DTD is "Valid" XML.
• DTD is Document Type Definition (DTD)
Eg:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note SYSTEM "Note.dtd">
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
• The DOCTYPE declaration in the example above, is a reference to an external DTD
file
Uses of XML
• Web publishing
• Web searching and automating Web tasks
• General applications
• e-business applications
THANK YOU

Contenu connexe

Tendances (20)

XML
XMLXML
XML
 
00 introduction
00 introduction00 introduction
00 introduction
 
Xml unit1
Xml unit1Xml unit1
Xml unit1
 
Xml
Xml Xml
Xml
 
XML Technologies
XML TechnologiesXML Technologies
XML Technologies
 
Unit iv xml dom
Unit iv xml domUnit iv xml dom
Unit iv xml dom
 
Html (1)
Html (1)Html (1)
Html (1)
 
Markup Languages
Markup Languages Markup Languages
Markup Languages
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handling
 
Fergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XML
Fergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XMLFergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XML
Fergus Fahey - DRI/ARA(I) Training: Introduction to EAD - Introduction to XML
 
Unit iv xml
Unit iv xmlUnit iv xml
Unit iv xml
 
Xml
XmlXml
Xml
 
Xml
Xml Xml
Xml
 
XML
XMLXML
XML
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Xml
XmlXml
Xml
 
Xml 215-presentation
Xml 215-presentationXml 215-presentation
Xml 215-presentation
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
XML
XMLXML
XML
 

En vedette (9)

Iterators and Generators
Iterators and GeneratorsIterators and Generators
Iterators and Generators
 
Liststore
ListstoreListstore
Liststore
 
JQuery
JQueryJQuery
JQuery
 
Database Abstraction Layer and Transaction in Stored procedures
Database Abstraction Layer and Transaction in Stored proceduresDatabase Abstraction Layer and Transaction in Stored procedures
Database Abstraction Layer and Transaction in Stored procedures
 
Memory management
Memory managementMemory management
Memory management
 
Functions with Heap and stack
 Functions with Heap and stack Functions with Heap and stack
Functions with Heap and stack
 
Array
ArrayArray
Array
 
Joins and unions
Joins and unionsJoins and unions
Joins and unions
 
CodeIgniter Framework
CodeIgniter FrameworkCodeIgniter Framework
CodeIgniter Framework
 

Similaire à Xml (20)

Xml passing in java
Xml passing in javaXml passing in java
Xml passing in java
 
Xml
XmlXml
Xml
 
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
 
BITM3730 10-31.pptx
BITM3730 10-31.pptxBITM3730 10-31.pptx
BITM3730 10-31.pptx
 
BITM3730 10-18.pptx
BITM3730 10-18.pptxBITM3730 10-18.pptx
BITM3730 10-18.pptx
 
xml.pptx
xml.pptxxml.pptx
xml.pptx
 
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
 
1 xml fundamentals
1 xml fundamentals1 xml fundamentals
1 xml fundamentals
 
Intro xml
Intro xmlIntro xml
Intro xml
 
XML - The Extensible Markup Language
XML - The Extensible Markup LanguageXML - The Extensible Markup Language
XML - The Extensible Markup Language
 
XML.pptx
XML.pptxXML.pptx
XML.pptx
 
Xml iet 2015
Xml iet 2015Xml iet 2015
Xml iet 2015
 
xml
xmlxml
xml
 
XML
XMLXML
XML
 
XML
XMLXML
XML
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
Unit3wt
Unit3wtUnit3wt
Unit3wt
 
paper about xml
paper about xmlpaper about xml
paper about xml
 

Plus de baabtra.com - No. 1 supplier of quality freshers

Plus de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Dernier

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Dernier (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Xml

  • 1.
  • 3. MAIN POINTS • What is XML • Difference between XML and HTML • How to use XML • XML tree • XML syntax • XML elements and attributes • Us e of xml
  • 4. What is XML? • XML stands for Extensible Markup Language • XML is a markup language much like HTML • XML was designed to carry data, not to display data • XML tags are not predefined. You must define your own tags • XML is designed to be self-descriptive • XML is a W3C Recommendation
  • 5. Difference Between XML and HTML  XML was designed to transport and store data, with focus on what data is  HTML was designed to display data, with focus on how data looks *HTML is about displaying information, while XML is about carrying information.
  • 6. XML Does Not DO Anything!!  Eg:- <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> - It has sender and receiver information - This XML document does not DO anything -- information wrapped in tags.
  • 7. Our Own Tags • XML allows the author to define his/her own tags and his/her own document structure. • Eg:- <to> and <from> in above example. XML is Not a Replacement for HTML • XML is a software- and hardware-independent tool for carrying information. • XML is used to transport data, while HTML is used to format and display the data.
  • 8. W3C Recommendation  XML became a W3C Recommendation on February 10, 1998. • XML is now as important for the Web as HTML was to the foundation of the Web. • XML is the most common tool for data transmissions between all sorts of applications.
  • 9. XML Separates Data from HTML • to display dynamic data in your HTML document, it will take a lot of work to edit the HTML each time the data changes. • With XML, data can be stored in separate XML files.  XML Simplifies Data Sharing • XML data is stored in plain text format. This provides a software- and hardware- independent way of storing data  XML Simplifies Data Transport • One of the most time-consuming challenges for developers is to exchange data between incompatible systems over the Internet. • Exchanging data as XML greatly reduces this complexity
  • 10. XML Simplifies Platform Changes • Upgrading to new systems (hardware or software platforms), is always time consuming and large amounts of data must be converted and incompatible data is often lost.. • XML data is stored in text format. This makes it easier to expand or upgrade to new operating systems, new applications, or new browsers, without losing data.  XML Makes Your Data More Available • Different applications can access your data, not only in HTML pages, but also from XML data sources.  XML is Used to Create New Internet Languages • XHTML • WSDL for describing available web services • WAP and WML as markup languages for handheld devices • RSS languages for news feeds • RDF and OWL for describing resources and ontology • SMIL for describing multimedia for the web
  • 11. XML Tree • XML documents form a tree structure that starts at "the root" and branches to "the leaves".  Eg: <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> - first line defines the XML version (1.0) and the encoding used (ISO-8859-1 = Latin- 1/West European character set). - The next line describes the root element of the document - The next 4 lines describe 4 child elements of the root - finally the last line defines the end of the root element
  • 12.
  • 13. Example: • <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> • The root element in the example is <bookstore>. All <book> elements in the document are contained within <bookstore>. • The <book> element has 4 children: <title>,< author>, <year>, <price>.
  • 14. XML Syntax Rules  All XML Elements Must Have a Closing Tag <p>This is a paragraph. <br> <p>This is a paragraph.</p> <br /> • Note: You might have noticed from the previous example that the XML declaration did not have a closing tag. This is not an error. The declaration is not a part of the XML document itself, and it has no closing tag.  XML Tags are Case Sensitive • The tag <Letter> is different from the tag <letter>  XML Elements Must be Properly Nested • <b><i>This text is bold and italic</i></b>  XML Documents Must Have a Root Element • <root> <child> <subchild>.....</subchild> </child> </root>
  • 15. • XML attribute values must be quoted • Eg: <note date="12/11/2007"> <to>Tove</to> <from>Jani</from> </note> • Entity References <message>if salary < 1000 then</message> <message>if salary &lt; 1000 then</message> &lt; < less than &gt; > greater than &amp; & ampersand &apos; ' apostrophe &quot; " quotation mark
  • 16. Comments in XML • similar to that of HTML - <!-- This is a comment --> White-space is Preserved in XML HTML:Hello Tove Output:Hello Tove • With XML, the white-space in a document is not truncated. XML Stores New Line as LF • In Windows applications, a new line is normally stored as a pair of characters: carriage return (CR) and line feed (LF) • XML stores a new line as LF.
  • 17. XML Elements • An XML element is everything from the element's start tag to the element's end tag. An element can contain: • other elements • text • attributes • or a mix of all of the above 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
  • 18. Best Naming Practices • Make names descriptive. Names with an underscore separator are nice: <first_name> • Names should be short and simple • Avoid "-" characters • Avoid "." characters • Avoid ":" characters
  • 19. XML Elements are Extensible • XML elements can be extended to carry more information. XML Attributes • Attributes provide additional information about an element. Eg: <img src="computer.gif"> <a href="demo.asp"> • Attribute values must always be quoted Eg:<person sex="female">
  • 20. XML Elements vs. Attributes Attribute: • <note date="10/01/2008"> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> Element: • <note> <date>10/01/2008</date> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>
  • 21. Problems with Attributes • attributes cannot contain multiple values (elements can) • attributes cannot contain tree structures (elements can) • attributes are not easily expandable (for future changes)
  • 22. XML Validation • XML validated against a DTD is "Valid" XML. • DTD is Document Type Definition (DTD) Eg: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE note SYSTEM "Note.dtd"> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> • The DOCTYPE declaration in the example above, is a reference to an external DTD file
  • 23. Uses of XML • Web publishing • Web searching and automating Web tasks • General applications • e-business applications

Notes de l'éditeur

  1. -Maybe it is a little hard to understand-self descriptive-must write a piece of software to send, receive or display it.
  2. XML defines the type of information contained in a document, making it easier to return useful results when searching the Web: