Successfully reported this slideshow.
Your SlideShare is downloading. ×

Introduction to XML

Upcoming SlideShare
Loading in …3

Check these out next

1 of 50 Ad

More Related Content

Viewers also liked (20)


More from Frederic Kaplan (19)


Recently uploaded (20)

Introduction to XML

  1. 1. [STANDARD] XML #DH101
  2. 2. What is XML and what is it good for ? #DH101
  3. 3. XML stands for eXtensibile Markup Language #DH101
  4. 4. To write in XML you write text with tags : <atag> my text </atag> #DH101
  5. 5. This can be done in any text editor. #DH101
  6. 6. XML is a W3C recommandation. #DH101
  7. 7. 4 characteristics #DH101
  8. 8. 1. XML is used to describe data, not to display them. XML does nothing. It describes. #DH101
  9. 9. 2. XML tags are not prede!ned. You can de!ne your own tags. This gives you a lot of freedom to describe the structure you want to describe. #DH101
  10. 10. 3. When you are satis!ed with your structure, you can !x our XML language by writing a DTD (Document Type Description). Thus, XML permits both "uidity and then rigor. #DH101
  11. 11. 4. XML is designed to be self- descriptive and “easily” readable. It is used to write “pivotal” descriptions in production chains. #DH101
  12. 12. Genealogy of XML #DH101
  13. 13. In the 50s, the !rst computers could not communicate with one another, if they were from di#erent brands. #DH101
  14. 14. In the 60s, IBM creates GML (Generalized Markup Language) to enable data exchanges and make the data structure explicit. #DH101
  15. 15. This is a great success. It becomes a standard : SGML (Standard Generalized Markup Language). The US fed gov. adopts it. #DH101
  16. 16. In the 90s, Tim Berners-Lee at CERN creates the HTML language using a subset of SGML. #DH101
  17. 17. HTML get specialized in displaying data but does not impose a standard way for describing data. #DH101
  18. 18. A group of researchers imagines another language to do this. The !rst version of XML is ready in 1998. #DH101
  19. 19. XML vs HTML #DH101
  20. 20. XML is a markup language like HTML. #DH101
  21. 21. XML is not a replacement of HTML. The two languages have di#erent goals. #DH101
  22. 22. XML is for the transport and the description of structured data. HTML is for the display and layout of data. #DH101
  23. 23. XML does nothing. It just describes. #DH101
  24. 24. XML is like a database in plain text. #DH101
  25. 25. Structure of an XML !le #DH101
  26. 26. XML Element <TAG>Text</TAG> Opening tag Content Closing tag
  27. 27. <BOOK> <TITLE>Da Vinci Code</TITLE> <AUTHOR>Dan Brown</AUTHOR> <YEAR>2003</YEAR> </BOOK>
  28. 28. With XML, you can create your own tags. #DH101
  29. 29. <BOOK> <TITLE>Da Vinci Code</TITLE> <AUTHOR>Dan Brown</AUTHOR> <YEAR>2003</YEAR> <STARS>4</STARS> </BOOK>
  30. 30. An XML !le starts with the version of XML used to describe the data and the text encoding format. #DH101
  31. 31. <?xml version="1.0" encoding="ISO-8859-1"?> <BOOK> <TITLE>Da Vinci Code</TITLE> <AUTHOR>Dan Brown</AUTHOR> <YEAR>2003</YEAR> </BOOK> ISO-8859-1 = Latin-1/West European character set
  32. 32. An XML document is organized like a tree. #DH101
  33. 33. <BOOK> <FRONT> <TITLE>... </TITLE> <AUTHOR>...</AUTHOR> </FRONT> <BODY>   <PART>     <CHAPTER>...</CHAPTER>   </PART> </BODY> </BOOK>
  34. 34. DTD #DH101
  35. 35. A well-formed XML document follows the general rules of XML syntax. #DH101
  36. 36. A valid XML document follows the speci!c rules written in a DTD (Document Type Description) #DH101
  38. 38. To use a DTD is not mandatory. #DH101
  39. 39. A DTD permits to agree on common XML dialect. #DH101
  40. 40. Some software permit to check whether an XML !le is valid compared to a given DTD. #DH101
  41. 41. Displaying XML #DH101
  42. 42. The way an XML !le is displayed can be speci!ed in a CSS stylesheet. #DH101
  43. 43. BOOK { display: block; margin-bottom: 30pt; margin-left: 0; } TITLE { display: block; color: #FF0000; font-size: 40pt; margin-left: 20pt; } AUTHOR { display: block; color: #0000FF; font-size: 30pt; margin-left: 20pt; } YEAR { display: block; color: #000000; font-size: 30pt; margin-left: 20pt; }
  44. 44. <?xml-stylesheet type="text/css" href="book.css"?>
  45. 45. A document can also be transformed using an XSLT script. This is now the recommended method #DH101
  46. 46. XML >> #DH101
  47. 47. XML permits to separate form from content by identifying structures reccurent to several documents. #DH101
  48. 48. Transformation Target Target Source Engine XML InDesign Indesign XSLT XSL-FO/PDF Paper / PDF ebook XHTML website XML Tablet ePub Webapp Reader Smartphone TXT MP3 player XML TEI / Doc Book Computer systems
  49. 49. >> XML #DH101
  50. 50. Word Database XML Scanned document Sensors ...