26.01.2019 Views

XML Simplified

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Module 1<br />

Introduction to <strong>XML</strong><br />

1.1.4 <strong>XML</strong> Markup<br />

<strong>XML</strong> markup defines the physical and logical layout of the document. <strong>XML</strong> can be considered as an<br />

information container. It contains shapes, labels, structures and also protects information. <strong>XML</strong> employs<br />

a tree-based structure to represent a document. The basic foundation of <strong>XML</strong> is laid down by symbols<br />

embedded in the text known as markup. The markup combines the text and extra information about the<br />

text like its structure and presentation. The markup divides the information into a hierarchy of character<br />

data and container-like elements and its attributes. A number of software programs process electronic<br />

documents use a markup.<br />

Concepts<br />

The underlying unit of <strong>XML</strong> is a character. The combination of characters is known as an entity. These<br />

entities are either present in the entity declaration or in a text file stored externally. All the characters are<br />

grouped together to form an <strong>XML</strong> document.<br />

<strong>XML</strong>’s markup divides a document into separate information containers called elements. A document<br />

consists of one outermost element called root element that contains all the other elements, plus some<br />

optional administrative information at the top, known as <strong>XML</strong> declaration. The following code demonstrates<br />

the elements.<br />

Code Snippet:<br />

<br />

- <br />

Rose<br />

$1<br />

Red in color<br />

700<br />

<br />

where,<br />

, , and inside the tags are elements.<br />

and are the root elements.<br />

The usage of <strong>XML</strong> can be observed in many real-life scenarios. It can be used in the fields of information<br />

sharing, single application usage, content delivery, re-use of data, separation of data and presentation,<br />

semantics, and so forth. News agencies are a common place where <strong>XML</strong> is used. News producers and<br />

news consumers often use a standard specification named <strong>XML</strong>News to produce, retrieve, and relay<br />

information across different systems in the world.<br />

Note: <strong>XML</strong> is a subset of SGML, with the same goals, but with as much of the complexity eliminated<br />

as possible. This means that any document which follows <strong>XML</strong>’s syntax rules will also follow SGML’s<br />

syntax rules, and can therefore be read by existing SGML tools.<br />

<strong>XML</strong> <strong>Simplified</strong><br />

Version 1.0 © Aptech Limited

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!