SlideShare a Scribd company logo
XML
Introduction What is XML? The Difference Between XML and HTML
How to use XML Separates Data from HTML XML Simplifies Data Sharing XML Simplifies Data Transport XML Simplifies Platform Changes XML is Used to Create New Internet Languages
XML Tree An 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 Rules All 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 References There 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 XML HTML truncates multiple white-space characters to one single white-space: HTML:  Hello           Tove Output:  Hello Tove With XML, the white-space in a document is not truncated. XML Stores New Line as LF ‘’ New line – Line feed CR – Carriage Return ‘’ LF – Line Feed ‘’
XML Elements What 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 Rules ,[object Object]
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 Practices ,[object Object]
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.,[object Object]

More Related Content

What's hot

XML
XMLXML
Xml
XmlXml
XML
XMLXML
Basic html
Basic htmlBasic html
Basic html
Drew Eric Noftle
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
Marco Bresciani
 
Html guide
Html guideHtml guide
Html guideDileysi
 
INTRODUCTION TO HTML
INTRODUCTION TO HTMLINTRODUCTION TO HTML
INTRODUCTION TO HTML
bwire sedrick
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
BG Java EE Course
 
Class2
Class2Class2
Class2
Jiyeon Lee
 
The Difference between HTML, XHTML & HTML5 for Beginners
The Difference between HTML, XHTML & HTML5 for BeginnersThe Difference between HTML, XHTML & HTML5 for Beginners
The Difference between HTML, XHTML & HTML5 for Beginners
Rasin Bekkevold
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
palhaftab
 
Xhtml
XhtmlXhtml
Introduction to html
Introduction to htmlIntroduction to html
Introduction to htmlvikasgaur31
 

What's hot (20)

XML
XMLXML
XML
 
Xml
XmlXml
Xml
 
Lecture 5 XML
Lecture 5  XMLLecture 5  XML
Lecture 5 XML
 
XML
XMLXML
XML
 
Basic html
Basic htmlBasic html
Basic html
 
XML Introduction
XML IntroductionXML Introduction
XML Introduction
 
Html guide
Html guideHtml guide
Html guide
 
Html1
Html1Html1
Html1
 
Xml
XmlXml
Xml
 
INTRODUCTION TO HTML
INTRODUCTION TO HTMLINTRODUCTION TO HTML
INTRODUCTION TO HTML
 
About XML
About XMLAbout XML
About XML
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Xml description
Xml descriptionXml description
Xml description
 
Class2
Class2Class2
Class2
 
The Difference between HTML, XHTML & HTML5 for Beginners
The Difference between HTML, XHTML & HTML5 for BeginnersThe Difference between HTML, XHTML & HTML5 for Beginners
The Difference between HTML, XHTML & HTML5 for Beginners
 
Lecture 2 introduction to html
Lecture 2  introduction to htmlLecture 2  introduction to html
Lecture 2 introduction to html
 
Xhtml
XhtmlXhtml
Xhtml
 
Xhtml
XhtmlXhtml
Xhtml
 
Sgml
SgmlSgml
Sgml
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 

Viewers also liked

business telephone systems
business telephone systemsbusiness telephone systems
business telephone systems
joe
 
Estudios
Estudios Estudios
Estudios
MariCc2
 
100818 chia khoa niem vui
100818 chia khoa niem vui100818 chia khoa niem vui
100818 chia khoa niem vuiTran Tuan
 
HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
Umar Ali
 
Hanh trinh-tro-thanh-nha-lanh-dao
Hanh trinh-tro-thanh-nha-lanh-daoHanh trinh-tro-thanh-nha-lanh-dao
Hanh trinh-tro-thanh-nha-lanh-daoXuan Le
 
JSON API_1110651039
JSON API_1110651039JSON API_1110651039
JSON API_1110651039gagahprawono
 
Destaques Projeto Suba
Destaques Projeto SubaDestaques Projeto Suba
Destaques Projeto Suba
JErickPPTs
 

Viewers also liked (7)

business telephone systems
business telephone systemsbusiness telephone systems
business telephone systems
 
Estudios
Estudios Estudios
Estudios
 
100818 chia khoa niem vui
100818 chia khoa niem vui100818 chia khoa niem vui
100818 chia khoa niem vui
 
HTML and XML Difference FAQs
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
 
Hanh trinh-tro-thanh-nha-lanh-dao
Hanh trinh-tro-thanh-nha-lanh-daoHanh trinh-tro-thanh-nha-lanh-dao
Hanh trinh-tro-thanh-nha-lanh-dao
 
JSON API_1110651039
JSON API_1110651039JSON API_1110651039
JSON API_1110651039
 
Destaques Projeto Suba
Destaques Projeto SubaDestaques Projeto Suba
Destaques Projeto Suba
 

Similar to Xml

Xml
XmlXml
Lotusphere 2006 AD212 Introduction to DXL
Lotusphere 2006 AD212 Introduction to DXLLotusphere 2006 AD212 Introduction to DXL
Lotusphere 2006 AD212 Introduction to DXLdominion
 
XML and XSLT
XML and XSLTXML and XSLT
XML and XSLT
Andrew Savory
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schema
gauravashq
 
What is xml
What is xmlWhat is xml
What is xml
Sachit Singh
 
XML processing with perl
XML processing with perlXML processing with perl
XML processing with perlJoe Jiang
 
Everything You Always Wanted To Know About XML But Were Afraid To Ask
Everything You Always Wanted To Know About XML But Were Afraid To AskEverything You Always Wanted To Know About XML But Were Afraid To Ask
Everything You Always Wanted To Know About XML But Were Afraid To Ask
Richard Davis
 
XML Training Presentation
XML Training PresentationXML Training Presentation
XML Training Presentation
Sarah Corney
 
Xml intro1
Xml intro1Xml intro1
Introduction To Xml
Introduction To XmlIntroduction To Xml
Introduction To Xml
bdebruin
 
Pmm05 16
Pmm05 16Pmm05 16
Pmm05 16
Rohit Luthra
 
Xml 150323102007-conversion-gate01
Xml 150323102007-conversion-gate01Xml 150323102007-conversion-gate01
Xml 150323102007-conversion-gate01
Niraj Bharambe
 
1.1 xhtml basics
1.1 xhtml basics1.1 xhtml basics
1.1 xhtml basicsBulldogs83
 
Douglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation JsonsagaDouglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation JsonsagaAjax Experience 2009
 

Similar to Xml (20)

Xmlphp
XmlphpXmlphp
Xmlphp
 
Xml
XmlXml
Xml
 
Xml
XmlXml
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 and XSLT
XML and XSLTXML and XSLT
XML and XSLT
 
Xml Demystified
Xml DemystifiedXml Demystified
Xml Demystified
 
Mdst 3559-02-01-html
Mdst 3559-02-01-htmlMdst 3559-02-01-html
Mdst 3559-02-01-html
 
3 xml namespaces and xml schema
3   xml namespaces and xml schema3   xml namespaces and xml schema
3 xml namespaces and xml schema
 
What is xml
What is xmlWhat is xml
What is xml
 
XML processing with perl
XML processing with perlXML processing with perl
XML processing with perl
 
Everything You Always Wanted To Know About XML But Were Afraid To Ask
Everything You Always Wanted To Know About XML But Were Afraid To AskEverything You Always Wanted To Know About XML But Were Afraid To Ask
Everything You Always Wanted To Know About XML But Were Afraid To Ask
 
Xml Schema
Xml SchemaXml Schema
Xml Schema
 
XML Training Presentation
XML Training PresentationXML Training Presentation
XML Training Presentation
 
Xml intro1
Xml intro1Xml intro1
Xml intro1
 
Introduction To Xml
Introduction To XmlIntroduction To Xml
Introduction To Xml
 
Pmm05 16
Pmm05 16Pmm05 16
Pmm05 16
 
Basic XML
Basic XMLBasic XML
Basic XML
 
Xml 150323102007-conversion-gate01
Xml 150323102007-conversion-gate01Xml 150323102007-conversion-gate01
Xml 150323102007-conversion-gate01
 
1.1 xhtml basics
1.1 xhtml basics1.1 xhtml basics
1.1 xhtml basics
 
Douglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation JsonsagaDouglas Crockford Presentation Jsonsaga
Douglas Crockford Presentation Jsonsaga
 

Recently uploaded

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
JezreelCabil2
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 

Recently uploaded (20)

Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Landownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptxLandownership in the Philippines under the Americans-2-pptx.pptx
Landownership in the Philippines under the Americans-2-pptx.pptx
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 

Xml

  • 1. XML
  • 2. Introduction What is XML? The Difference Between XML and HTML
  • 3. How to use XML Separates Data from HTML XML Simplifies Data Sharing XML Simplifies Data Transport XML Simplifies Platform Changes XML is Used to Create New Internet Languages
  • 4. XML Tree An 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 Rules All 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 References There 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 XML HTML truncates multiple white-space characters to one single white-space: HTML: Hello Tove Output: Hello Tove With XML, the white-space in a document is not truncated. XML Stores New Line as LF ‘’ New line – Line feed CR – Carriage Return ‘’ LF – Line Feed ‘’
  • 9. XML Elements What 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.
  • 11. Names cannot start with a number or punctuation character
  • 12. Names cannot start with the letters xml (or XML, or Xml, etc)
  • 13.
  • 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.
  • 19.
  • 20. attributes cannot contain tree structures (elements can)
  • 21.
  • 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 Validator Syntax-Check Your XML http://www.w3schools.com/xml/xml_validator.asp Syntax-Check an XML File http://www.w3schools.com/xml/xml_validator.asp Validate 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.xml http://www.w3schools.com/xml/cd_catalog.txt http://www.w3schools.com/xml/cd_catalog_with_css.xml
  • 25. To be continued Schema Namespace DTD CDATA Parser Etc….