introduction to xml
DESCRIPTION
This introduction is part of the DH101 course. Check dh101.chTRANSCRIPT
![Page 1: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/1.jpg)
[STANDARD]
#DH101
XML
![Page 2: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/2.jpg)
#DH101
What is XML and what is it good for ?
![Page 3: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/3.jpg)
#DH101
XML stands for eXtensibile Markup Language
![Page 4: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/4.jpg)
#DH101
To write in XMLyou write text with tags :
<atag> my text </atag>
![Page 5: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/5.jpg)
#DH101
This can be done in any text editor.
![Page 6: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/6.jpg)
#DH101
XML is a W3C recommandation.
![Page 7: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/7.jpg)
#DH101
4 characteristics
![Page 8: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/8.jpg)
#DH101
1. XML is used to describe data, not to display them. XML does nothing. It describes.
![Page 9: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/9.jpg)
#DH101
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.
![Page 10: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/10.jpg)
#DH101
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.
![Page 11: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/11.jpg)
#DH101
4. XML is designed to be self-descriptive and “easily” readable. It is used to write “pivotal” descriptions in production chains.
![Page 12: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/12.jpg)
#DH101
Genealogy of XML
![Page 13: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/13.jpg)
#DH101
In the 50s, the !rst computers could not communicate with one another, if they were from di#erent brands.
![Page 14: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/14.jpg)
#DH101
In the 60s, IBM creates GML (Generalized Markup Language) to enable data exchanges and make the data structure explicit.
![Page 15: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/15.jpg)
#DH101
This is a great success. It becomes a standard : SGML(Standard Generalized Markup Language).The US fed gov. adopts it.
![Page 16: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/16.jpg)
#DH101
In the 90s, Tim Berners-Lee at CERN creates the HTML language using a subset of SGML.
![Page 17: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/17.jpg)
#DH101
HTML get specialized in displaying data but does not impose a standard way for describing data.
![Page 18: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/18.jpg)
#DH101
A group of researchers imagines another language to do this.The !rst version of XML is ready in 1998.
![Page 19: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/19.jpg)
#DH101
XML vs HTML
![Page 20: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/20.jpg)
#DH101
XML is a markup language like HTML.
![Page 21: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/21.jpg)
#DH101
XML is not a replacement of HTML. The two languages have di#erent goals.
![Page 22: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/22.jpg)
#DH101
XML is for the transport and the description of structured data.
HTML is for the display and layout of data.
![Page 23: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/23.jpg)
#DH101
XML does nothing.It just describes.
![Page 24: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/24.jpg)
#DH101
XML is like a database in plain text.
![Page 25: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/25.jpg)
#DH101
Structure of an XML !le
![Page 26: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/26.jpg)
<TAG>Text</TAG>
XML Element
Opening tag Closing tagContent
![Page 27: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/27.jpg)
<BOOK><TITLE>Da Vinci Code</TITLE><AUTHOR>Dan Brown</AUTHOR><YEAR>2003</YEAR></BOOK>
![Page 28: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/28.jpg)
#DH101
With XML, you can create your own tags.
![Page 29: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/29.jpg)
<BOOK><TITLE>Da Vinci Code</TITLE><AUTHOR>Dan Brown</AUTHOR><YEAR>2003</YEAR><STARS>4</STARS></BOOK>
![Page 30: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/30.jpg)
#DH101
An XML !le starts with the version of XML used to describe the data and the text encoding format.
![Page 31: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/31.jpg)
<?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
![Page 32: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/32.jpg)
#DH101
An XML document is organized like a tree.
![Page 33: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/33.jpg)
<BOOK> <FRONT> <TITLE>... </TITLE> <AUTHOR>...</AUTHOR> </FRONT> <BODY> <PART> <CHAPTER>...</CHAPTER> </PART> </BODY></BOOK>
![Page 34: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/34.jpg)
#DH101
DTD
![Page 35: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/35.jpg)
#DH101
A well-formed XML document follows the general rules of XML syntax.
![Page 36: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/36.jpg)
#DH101
A valid XML document follows the speci!c rules written in a DTD (Document Type Description)
![Page 37: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/37.jpg)
<!DOCTYPE BOOK[<!ELEMENT BOOK (TITLE,AUTHOR,YEAR)><!ELEMENT TITLE (#PCDATA)><!ELEMENT AUTHOR (#PCDATA)><!ELEMENT YEAR (#PCDATA)>]>
![Page 38: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/38.jpg)
#DH101
To use a DTD is not mandatory.
![Page 39: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/39.jpg)
#DH101
A DTD permits to agree on common XML dialect.
![Page 40: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/40.jpg)
#DH101
Some software permit to check whether an XML !le is valid compared to a given DTD.
![Page 41: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/41.jpg)
#DH101
Displaying XML
![Page 42: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/42.jpg)
#DH101
The way an XML !le is displayed can be speci!ed in a CSS stylesheet.
![Page 43: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/43.jpg)
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;}
![Page 44: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/44.jpg)
<?xml-stylesheet type="text/css" href="book.css"?>
![Page 45: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/45.jpg)
#DH101
A document can also be transformed using an XSLT script. This is now the recommended method
![Page 46: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/46.jpg)
#DH101
XML >>
![Page 47: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/47.jpg)
#DH101
XML permits to separate form from content by identifying structures reccurent to several documents.
![Page 48: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/48.jpg)
XML
XML InDesignXSL-FO/PDF
XHTML
ePub
TXT
XML TEI / Doc Book
IndesignPaper / PDF ebook
websiteTabletWebappReaderSmartphone
MP3 player
Computer systems
SourceTransformation
EngineTarget Target
XSLT
![Page 49: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/49.jpg)
#DH101
>> XML
![Page 50: Introduction to XML](https://reader033.vdocuments.mx/reader033/viewer/2022052522/5549fa9cb4c905507a8b4969/html5/thumbnails/50.jpg)
Word
Database
Scanned document
Sensors
...
XML