Beruflich Dokumente
Kultur Dokumente
EXtensibleMarkupLanguage
By Sandeep
Sharma
machine-readable.
2
XML Example 1
<?xmlversion="1.0"encoding="UTF-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML Example 2
<?xmlversion="1.0"encoding="UTF-8"?>
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>Our famous Belgian Waffles with plenty of real maple
syrup</description>
<calories>650</calories>
</food>
<food>
<name>French Toast</name>
<price>$4.50</price>
<description>Thick slices made from our homemade sourdough
bread</description>
<calories>600</calories>
</food>
<food>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
<description>Two eggs, bacon or sausage, toast, and our ever-popular hash
browns</description>
<calories>950</calories>
</food>
</breakfast_menu>
Output:
Introduction toXML
XML is a software- and
hardware-independent tool
for storing and transporting
data.
6
What is XML?
XML stands for EXtensible Markup Language
XML is a markup language much like HTML
XML was designed to store and transport data
XML was designed to be self-descriptive
XML is a W3C Recommendation
10
11
XML is Extensible
<note>
<date>2015-09-01</date>
<hour>08:30</hour>
<to>Tove</to>
<from>Jani</from>
<body>Don't forget me this weekend!</body>
</note>
12
13
XML stores data in plain text format. This provides a software- and
hardware-independent way of storing, transporting, and sharing data.
With XML, data can be available to all kinds of "reading machines" like
people, computers, voice machines, news feeds, etc.
14
XML is a W3C
Recommendation
Became a W3C
ecommendation on
February 10, 1998.
15
16
20
Books.xml
<?xml version="1.0"encoding="UTF-8"?>
<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">XQuery Kick Start</title>
<author>James McGovern</author>
<author>Per Bothner</author>
<author>Kurt Cagle</author>
<author>James Linn</author>
<author>Vaidyanathan Nagarajan</author>
<year>2003</year>
<price>49.99</price>
</book>
<book category="web"cover="paperback">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
21
Transaction Data
Thousands of XML formats exists, in many different
industries, to describe day-to-day data
transactions:
22
24
25
XMLTree
XML documents form a tree structure
that starts at "the root" and branches to
"the leaves".
26
27
28
An XML tree starts at aroot elementand branches from the root tochild
elements.
The terms parent, child, and sibling are used to describe the relationships between
elements.
Parent have children. Children have parents. Siblings are children on the same level
(brothers and sisters). All elements can have text content (Harry Potter) and
attributes (category="cooking").
29
Self-Describing Syntax
30