0% found this document useful (0 votes)
35 views

What Is XML

XML is a markup language that defines rules for encoding documents in a human-readable and machine-readable format. XML documents have a prolog and a root element, and elements can have child and sibling elements in a hierarchical tree structure. XML tags are user-defined and XML was designed to describe data rather than display it like HTML. An example XML document shows a bookstore with book elements that have child elements for title, author, year, and price.

Uploaded by

har2dik
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

What Is XML

XML is a markup language that defines rules for encoding documents in a human-readable and machine-readable format. XML documents have a prolog and a root element, and elements can have child and sibling elements in a hierarchical tree structure. XML tags are user-defined and XML was designed to describe data rather than display it like HTML. An example XML document shows a bookstore with book elements that have child elements for title, author, year, and price.

Uploaded by

har2dik
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

What is XML?

Extensible Markup Language (XML) is a markup language that defines a set of rules for
encoding documents in a format that is both human-readable and machine-readable.
The design goals of XML emphasize simplicity, generality, and usability over the Internet.

XML stands for Extensible Markup Language


XML is a markup language much like HTML
XML is designed to be self-descriptive.
XML was designed to describe data, not to display data.
XML tags are not predefined. You must define your own tags.

XML and HTML were designed with different goals:

XML was designed to describe data, with focus on what data is.
HTML was designed to display data, with focus on how data looks.

XML Structure
An XML file having two Parts.

Prolog

Document Element (root element)

1. The Prologue
The prologue, equivalent to the header in HTML, may include the following:

An XML declaration (optional) such as:


<? xml version="1.0"?>

2. Document Element
XML documents must contain a root element. This element is "the parent" of all other
elements.
The elements in an XML document form a document tree. The tree starts at the root and
branches to the lowest level of the tree.
All elements can have sub elements (child elements):
<root>
<child>
<subchild>.....</subchild>
</child>
</root>

The terms parent, child, and sibling are used to describe the relationships between
elements. Parent elements have children. Children on the same level are called siblings
(brothers or sisters).
All elements can have text content and attributes (just like in HTML).
Example:
<?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>
</bookstore>

You might also like