Untitled Document



 Introduction to XML
 Markup Laguages
   Internet Introduction
   Markup Languages
 Specific Markup  Languages
 Generalized Markup  Language
 SGML - A  MetaLanguage
   SGML - Example
 XML over HTML
 Introduction to XML
 
   What XML does?
 Need for XML based  Languages
   Publishing XML
 XML and word  processors
 Checking XML  Structure
 XML - Document  presentation
 XML over SGML
 XML Structure
 
   XML structure
   Logical structure
   XML Declaration
 Document Type  Declaration
 Physical Structure in  XML
 Parsed and Unparsed  Entities
   Predefined Entities
 Internal and External  Entity
   XML General Syntax
   Attributes
   Valid Documents
 Well - Formed  Documents
 Data Definition and Data  Modeling
 Namespaces and  Schemas
 Linking and Querying
 Ecommerce Application  using XML

Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.




 Introduction to XML > Introduction to XML

  What XML does?

XML is all about preserving useful information - information that computers can use to be more intelligent about what they do with our data. The best part of XML is that it liberates information from the shackles of a fixed-tag set.

XML provides a standard approach for describing, capturing, processing and publishing information. It is a language that has significant benefits over HTML.

Unlike most markup languages, XML is a flexible framework in which you can create your own customized markup languages. All XML-based languages will share the same look and feel and they share a common basic syntax. Some XML based languages already exist in fields such as Push Technologies, Electronic Commerce and Mathematics.

  Need for XML based Languages

The main advantage of being able to define your own markup language is that it gives you the freedom to capture and publish useful information about what your data is and how it is structured. To show the difference, consider a company wanting to sell books in the web. If they want to publish the information about the books in a web page then we need to write an HTML document like the one as shown.

The original data has been formed into HTML for publishing purposes. In the course of that transformation, useful information about what the information really is has been lost. If the same content were to be written in XML, it would look like the following code snippet.

<!-Book Snippet in HTML -->
<h1>Books for Sale</h1>
<table border=1>
<tr>
<td>
Title</td><td>Paradise Lost</td>
</tr>
<tr>
<td>
Author</td><td>John Milton</td>
</tr></table>

<!-Book snippet in XML -->
<BooksForSale>
<Title>Paradise Lost</Title>
<Author>John Milton</Author>
</BooksForSale>

If this code were to be published on the web, this representation opens up some pretty interesting possibilities. The image as shown illustrates the possibilities.

  Publishing XML

Keeping the information in pieces of data like in XML lets the browser do the work of formatting the data on the user's screen. This even allows the users to choose between a variety of looks or presentation formats for the same data.

This also lets the user's browser perform calculations on the data, and manipulate and display the results in a variety of ways.

Representing information in this way allows intelligent searching of the information. And performing complex queries on the data can be done easily. For example, we can find answer to questions such as "how many books written by a particular author are available".

Building rich links between different types of information is very easy when data is formatted in this way. For example, the sales invoice can be linked with the Books.

When a set of XML element types are Standardized, it can be used for an entire industry, such as book vendors as in the previous example, where each book vendor need not define the tags again, they can use the same tags which has already been implemented.

  XML and word processors

A word processor - especially a WYSIWYG (What You See Is What You Get) word processor combines content and presentation in a very tight embrace. Using such tools we create documents with a specific output device in mind. These processors look much into the presentation and the content.

In word processors, which follow WYSIWYG philosophy, the structure concept is hardly present at all. The only structural information stored relates to the creation of the final paper output, such as details about page margins, font sizes, and so on.

The structure inherent in documents are important to look into, when it comes to documents such as procedure manuals, invoices etc. In these cases the structure of the document is as important as the content itself. Presentation of information is also important but this information is kept well separated from the content.

In XML, you create document content by concentrating on what the information really is and how it is structured. XML documents also gives importance to the presentation, whereon XML documents can be made to look arbitrarily beautiful without intertwining the formatting information with the core content of the document.


  Checking XML Structure

XML includes a mechanism for defining rules that control how documents are structured. In jargon, these are called Document Type Definitions, or DTDs for short.

Using DTD, XML documents can be arranged. So that these documents may be automatically checked in various ways.

The DTD has the list of the element types that are to be used in the document, indicating the structural order in which they can occur. A utility program called an XML parser tests whether or not the document meets the prescribed rules.

  XML - Document presentation

Making XML documents look nice, either in a browser or on a sheet of paper, is the responsibility of an XML subsidiary standard called XSL (eXtensible Stylesheet Language).

We come across something called Cascading Style Sheets (CSS) for HTML. The core idea of these CSS is to capture details about how the various elements in a document should look and then store them in a separate document, rather than to interlink them with the content of the document. Separating the two allows the presentation to be changed by simply changing the style sheet.

XSL is the proposed style-sheet language for XML. It is more powerful than CSS yet broadly compatible with it. In the same way that XML is a subset of the SGML International Standard (ISO 8879), XSL is a simplified subset of the International Standard style language known DSSSL (ISO/IEC 10179).


  XML over SGML

Even though XML is a subset of Standard Generalized Markup Language (SGML), XML is optimized for use on the World Wide Web. XML is designed in such a way that it has some benefits that are not found in SGML.

XML is a smaller language than SGML. The designers of XML removed some specifications in SGML that was not needed for Web delivery.

XML includes a specification for hyperlinking scheme, which is described as a separate language called eXtensible Linking Language (XLL). XML supports the basic hyperlinking found in HTML as well as extended linking.

XML includes specification for a style sheet language called eXtensible Stylesheet Language (XSL). XSL provides support for a style sheet mechanism, which allows an author to create a template of various styles.

XML documents are self-describing documents. That is, each document contains a set of rules to which its data must conform. Since the same set of rules can be reused in another document, other authors can easily create the same class of document, if necessary.

XML can be used as data interchange format. Many legacy systems can contain data in disparate forms, and developers are doing a lot of work to connect these legacy systems using the Internet. Since the XML text format is standards based, data can be converted to XML and then easily read by another system or application.

XML can be used for Web data. For example, the content is stored in an XML file and the HTML page is used simply for formatting and display. So, the content can be updated, translated into another language without modifying anything in the HTML code.

Back Next


Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.




17, Vadsarvala Nivas, 65-A, J. Nehru Road, Mulund (W), Mumbai - 400 080 INDIA
Tel : 91-22-25795588, 91-22-25780444 Fax : 91-22-25793397
Email : ionline@vsnl.com
© Image Online 2001-2003