You are on page 1of 7

The eXtensible Markup Language

(XML)

Presented By:
Jyoti Prakash Uprety
Presentation Outline

 Part 1: What is XML?


 Part 2:Basic rules to write XML document.
Part 1: About XML

 An Extensible Markup Language (XML)


document describes the structure of data
 XML and HTML have a similar syntax …
both derived from SGML
 XML was designed to store and transport
data
 An XML document resides in its own file with
an ‘.xml’ extension
Main Components of an XML
Document

 Elements: <hello>

 Attributes: <item id=“33905”>

 Entities: &lt; (<)

 Advanced Components
– CData Sections
– Processing Instructions
An Example XML Document

 An example of an well-commented XML document


<?xml version="1.0" encoding="UTF-8"?>
<books>
<book> <book>

<name>C- <name>Dotnet</name>
programming</name> <page>305</page>
<page>345</page> <price>424</price>
<price>435</price> </book>
</book> <book>
<book> <name>Nice book</name>
<name>Java <page>8345</page>
Programming</name>
<price>435</price>
<page>3345</page>
</book>
<price>435</price> </books>
</book>
<book>
<name>Python</name>
<page>845</page>
<price>435</price>
Part 2:The Basic Rules

 All XML must have a root element.


 All tags must be closed.
 All tags must be properly nested.
 Tag names have strict limits.
 Tag names are case sensitive.
 Tag names cannot contain spaces.
 Attribute values must appear within quotes (" ") .
 White space is preserved.
 HTML tags should be avoided (optional).
END

Thank you!

You might also like