SlideShare a Scribd company logo
XML
IntroductionWhat is XML?The Difference Between XML and HTML
How to useXML Separates Data from HTMLXML Simplifies Data SharingXML Simplifies Data TransportXML Simplifies Platform ChangesXML is Used to Create New Internet Languages
XML TreeAn Example XML Document<?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>
XML Tree cont..	XML Documents Form a Tree Structure<bookstore>  <book category="COOKING">    <title lang="en">Everyday Italian</title>    <author>Giada De Laurentiis</author>    <year>2005</year>    <price>30.00</price>  </book>
XML Syntax RulesAll XML Elements Must Have a Closing Tag<p>This is another paragraph</p>XML Tags are Case Sensitive<Message>This is incorrect</message><message>This is correct</message>XML Elements Must be Properly Nested<b><i>This text is bold and italic</b></i><b><i>This text is bold and italic</i></b>
XML Syntax Rules cont..XML Documents Must Have a Root Element<root>  <child>  .....   </child></root>XML Attribute Values Must be Quoted<note date="12/11/2007">…</note>Entity ReferencesThere are 5 predefined entity references in XML:&lt; 	< 	less than &gt; 	> 	greater than &amp; 	& 	ampersand  &apos; 	' 	apostrophe &quot; 	" 	quotation mark <message>if salary &lt; 1000 then</message>
XML Syntax Rules cont…Comments in XML<!-- This is a comment --> White-space is Preserved in XMLHTML truncates multiple white-space characters to one single white-space:HTML:  Hello           ToveOutput:  Hello ToveWith XML, the white-space in a document is not truncated.XML Stores New Line as LF‘\n’New line – Line feedCR – Carriage Return ‘\r’LF – Line Feed ‘\n’
XML ElementsWhat is an XML Element?<bookstore>  <book category="CHILDREN">    <title>Harry Potter</title>    <author>J K. Rowling</author>    <year>2005</year>    <price>29.99</price>  </book>  <book category="WEB">    <title>Learning XML</title>    <author>Erik T. Ray</author>    <year>2003</year>    <price>39.95</price>  </book></bookstore>
XML Elements cont…XML Naming RulesNames 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 spacesBest Naming PracticesMake names descriptive. Names with an underscore separator are nice: <first_name>, <last_name>.
Names should be short and simple, like this: <book_title> not like this: <the_title_of_the_book>.
Avoid "-" characters. If you name something "first-name," some software may think you want to subtract name from first.
Avoid "." characters. If you name something "first.name," some software may think that "name" is a property of the object "first."
Avoid ":" characters. Colons are reserved to be used for something called namespaces (more later).
Non-English letters like éòá are perfectly legal in XML, but watch out for problems if your software vendor doesn't support them.XML Attributes<file type="gif">computer.gif</file>XML Attributes Must be Quoted<person sex="female"> or <person sex='female'>XML Elements vs. Attributes<person gender="female">  <firstname>Anna</firstname>  <lastname>Smith</lastname></person><person>  <gender >female</gender >  <firstname>Anna</firstname>  <lastname>Smith</lastname></person>

More Related Content

PPSX
PDF
Xml tutorial
 
PPTX
Xml ppt
PPTX
Week1 xml
PPT
Introduction to XML
PPSX
Introduction to basic html by Danielle Douglas
Xml tutorial
 
Xml ppt
Week1 xml
Introduction to XML
Introduction to basic html by Danielle Douglas

What's hot (20)

PPT
Basic html
PDF
XML Introduction
PPTX
Html guide
PPT
PPT
DOCX
INTRODUCTION TO HTML
PPT
PPT
Introduction to XML
PPT
Xml description
PPTX
Class2
PPTX
The Difference between HTML, XHTML & HTML5 for Beginners
PPTX
Lecture 2 introduction to html
PPT
PPS
PPTX
PPT
Introduction to html
Basic html
XML Introduction
Html guide
INTRODUCTION TO HTML
Introduction to XML
Xml description
Class2
The Difference between HTML, XHTML & HTML5 for Beginners
Lecture 2 introduction to html
Introduction to html
Ad

Viewers also liked (7)

PDF
business telephone systems
PPTX
Estudios
PPS
100818 chia khoa niem vui
PDF
HTML and XML Difference FAQs
PDF
Hanh trinh-tro-thanh-nha-lanh-dao
PDF
JSON API_1110651039
PPTX
Destaques Projeto Suba
business telephone systems
Estudios
100818 chia khoa niem vui
HTML and XML Difference FAQs
Hanh trinh-tro-thanh-nha-lanh-dao
JSON API_1110651039
Destaques Projeto Suba
Ad

Similar to Xml (20)

PPT
PPT
PPT
PPT
Lotusphere 2006 AD212 Introduction to DXL
PPT
XML and XSLT
PDF
Xml Demystified
PPTX
Mdst 3559-02-01-html
PPT
3 xml namespaces and xml schema
PPTX
What is xml
PPT
XML processing with perl
PPT
Everything You Always Wanted To Know About XML But Were Afraid To Ask
PPT
Xml Schema
PPT
XML Training Presentation
DOC
Web Technology XML Attributes and elementsUnit 3.doc
PPT
Introduction To Xml
PPT
Pmm05 16
PPTX
Basic XML
DOCX
Xml 150323102007-conversion-gate01
PPT
1.1 xhtml basics
Lotusphere 2006 AD212 Introduction to DXL
XML and XSLT
Xml Demystified
Mdst 3559-02-01-html
3 xml namespaces and xml schema
What is xml
XML processing with perl
Everything You Always Wanted To Know About XML But Were Afraid To Ask
Xml Schema
XML Training Presentation
Web Technology XML Attributes and elementsUnit 3.doc
Introduction To Xml
Pmm05 16
Basic XML
Xml 150323102007-conversion-gate01
1.1 xhtml basics

Recently uploaded (20)

PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
01-Introduction-to-Information-Management.pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Trump Administration's workforce development strategy
PPTX
master seminar digital applications in india
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
UNIT III MENTAL HEALTH NURSING ASSESSMENT
PDF
Anesthesia in Laparoscopic Surgery in India
Final Presentation General Medicine 03-08-2024.pptx
Orientation - ARALprogram of Deped to the Parents.pptx
Weekly quiz Compilation Jan -July 25.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Cell Structure & Organelles in detailed.
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Module 4: Burden of Disease Tutorial Slides S2 2025
01-Introduction-to-Information-Management.pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
STATICS OF THE RIGID BODIES Hibbelers.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Trump Administration's workforce development strategy
master seminar digital applications in india
What if we spent less time fighting change, and more time building what’s rig...
UNIT III MENTAL HEALTH NURSING ASSESSMENT
Anesthesia in Laparoscopic Surgery in India

Xml

  • 1. XML
  • 2. IntroductionWhat is XML?The Difference Between XML and HTML
  • 3. How to useXML Separates Data from HTMLXML Simplifies Data SharingXML Simplifies Data TransportXML Simplifies Platform ChangesXML is Used to Create New Internet Languages
  • 4. XML TreeAn Example XML Document<?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>
  • 5. XML Tree cont.. XML Documents Form a Tree Structure<bookstore>  <book category="COOKING">    <title lang="en">Everyday Italian</title>    <author>Giada De Laurentiis</author>    <year>2005</year>    <price>30.00</price>  </book>
  • 6. XML Syntax RulesAll XML Elements Must Have a Closing Tag<p>This is another paragraph</p>XML Tags are Case Sensitive<Message>This is incorrect</message><message>This is correct</message>XML Elements Must be Properly Nested<b><i>This text is bold and italic</b></i><b><i>This text is bold and italic</i></b>
  • 7. XML Syntax Rules cont..XML Documents Must Have a Root Element<root>  <child>  .....   </child></root>XML Attribute Values Must be Quoted<note date="12/11/2007">…</note>Entity ReferencesThere are 5 predefined entity references in XML:&lt; < less than &gt; > greater than &amp; & ampersand &apos; ' apostrophe &quot; " quotation mark <message>if salary &lt; 1000 then</message>
  • 8. XML Syntax Rules cont…Comments in XML<!-- This is a comment --> White-space is Preserved in XMLHTML truncates multiple white-space characters to one single white-space:HTML: Hello ToveOutput: Hello ToveWith XML, the white-space in a document is not truncated.XML Stores New Line as LF‘\n’New line – Line feedCR – Carriage Return ‘\r’LF – Line Feed ‘\n’
  • 9. XML ElementsWhat is an XML Element?<bookstore>  <book category="CHILDREN">    <title>Harry Potter</title>    <author>J K. Rowling</author>    <year>2005</year>    <price>29.99</price>  </book>  <book category="WEB">    <title>Learning XML</title>    <author>Erik T. Ray</author>    <year>2003</year>    <price>39.95</price>  </book></bookstore>
  • 10. XML Elements cont…XML Naming RulesNames can contain letters, numbers, and other characters
  • 11. Names cannot start with a number or punctuation character
  • 12. Names cannot start with the letters xml (or XML, or Xml, etc)
  • 13. Names cannot contain spacesBest Naming PracticesMake names descriptive. Names with an underscore separator are nice: <first_name>, <last_name>.
  • 14. Names should be short and simple, like this: <book_title> not like this: <the_title_of_the_book>.
  • 15. Avoid "-" characters. If you name something "first-name," some software may think you want to subtract name from first.
  • 16. Avoid "." characters. If you name something "first.name," some software may think that "name" is a property of the object "first."
  • 17. Avoid ":" characters. Colons are reserved to be used for something called namespaces (more later).
  • 18. Non-English letters like éòá are perfectly legal in XML, but watch out for problems if your software vendor doesn't support them.XML Attributes<file type="gif">computer.gif</file>XML Attributes Must be Quoted<person sex="female"> or <person sex='female'>XML Elements vs. Attributes<person gender="female">  <firstname>Anna</firstname>  <lastname>Smith</lastname></person><person>  <gender >female</gender >  <firstname>Anna</firstname>  <lastname>Smith</lastname></person>
  • 19. XML Attributes cont…Avoid XML Attributes?Some of the problems with using attributes are:attributes cannot contain multiple values (elements can)
  • 20. attributes cannot contain tree structures (elements can)
  • 21. attributes are not easily expandable (for future changes)XML ValidationValid XML Documents<?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>
  • 22. XML Validation cont…XML DTD[<!ELEMENT note (to,from,heading,body)><!ELEMENT to (#PCDATA)><!ELEMENT from (#PCDATA)><!ELEMENT heading (#PCDATA)><!ELEMENT body (#PCDATA)>]>XML Schema<xs:element name="note"><xs:complexType>  <xs:sequence>    <xs:element name="to" type="xs:string"/>    <xs:element name="from" type="xs:string"/>    <xs:element name="heading" type="xs:string"/>    <xs:element name="body" type="xs:string"/>  </xs:sequence></xs:complexType></xs:element>
  • 23. XML ValidatorSyntax-Check Your XMLhttp://www.w3schools.com/xml/xml_validator.aspSyntax-Check an XML Filehttp://www.w3schools.com/xml/xml_validator.aspValidate Your XML Against a DTD
  • 24. Displaying XML with CSS<?xml version="1.0" encoding="ISO-8859-1"?><?xml-stylesheet type="text/css" href="cd_catalog.css"?><CATALOG>  <CD>    <TITLE>Empire Burlesque</TITLE>    <ARTIST>Bob Dylan</ARTIST>    <COUNTRY>USA</COUNTRY>    <COMPANY>Columbia</COMPANY>    <PRICE>10.90</PRICE>    <YEAR>1985</YEAR>  </CD>  <CD>    <TITLE>Hide your heart</TITLE>    <ARTIST>Bonnie Tyler</ARTIST>    <COUNTRY>UK</COUNTRY>    <COMPANY>CBS Records</COMPANY>    <PRICE>9.90</PRICE>    <YEAR>1988</YEAR>  </CD>...</CATALOG>http://www.w3schools.com/xml/cd_catalog.xmlhttp://www.w3schools.com/xml/cd_catalog.txthttp://www.w3schools.com/xml/cd_catalog_with_css.xml