Introduction

 

In the e-world, we constantly hear of proclamations about the concept of transacting business sans human intervention. This concept is bolstered by the ability to program electronic devices in such a manner, so as to enable them to perform all the requisite tasks by themselves, totally independent of any human involvement.

 

For instance, if your refrigerator malfunctions, it would be able to register a complaint with the mechanic's computer, specifying the details of the glitch. So, don't be bewildered if a mechanic arrives unannounced at your doorstep and apprises you of the defect in your fridge, which you obviously would be oblivious to.

 

In such a scenario, when these gadgets and machines need to collaborate with one another, data has to flow to and fro between them. This data has to be in a specific format to facilitate apt and precise interpretation at both ends. To enable this, the data must be validated prior to the occurrence of any such transaction. It is here that the XML Schema plays a vital role by validating the data that flows back and forth.

 

The XML Schema specifies the properties of a resource, while the XML file stipulates a set of values for these properties. The primary utility of the XML Schema lies in its ability to concede generous amount of autonomy to the programmer to define the rules of data validity; and thereafter, to hand over the responsibility of data validation to the XML validator. This liberates the programmer from the mundane drudgery of the task of data validation.

 

The reader must be acquainted with the C# programming language since the XML Schema and the XML files are read and written to using program written in this language. Also, it is assumed that the reader is conversant with XML too. 

 

The book gets underway with the chapter on Dataset, which delves upon the concepts that relate to a database. It acquaints you with the nuances of the xsd file and its importance in the scheme of things.

 

The next chapter handles the concept of validating an XML file using the XML Schema, which is a surrogate for the Document Type Description or DTD. It encompasses all the rules that the XML file must conform to.

 

Then, in the next few chapters, the focus is veered towards the assimilation of the basic elements of the Schema file, such as attributes, inheritance, namespaces and restrictions. An entire chapter is dedicated to each one of them, wherein they are explored in considerable detail. Then, the intricacies of creating the XML Schema files using a program, are revealed. Finally, the last chapter in the book inquires into the mechanism of how the XML Schema Definition tool can be used to generate the XML Schema and the C# classes.

 

Thus, a beautiful tapestry of topics has been spread before your eyes, woven together to bridge the chasm of ignorance about the XML Schema. The heady mélange of theory and examples eases the task of comprehending complex concepts.

 

By its inherent nature, the métier of software programming makes it mandatory for programmers to remain on the cutting edge of technology. Therefore, we entreat you to throw forbearance to the wind and set about the task of updating your knowledge about the XML Schema without any further ado.

 

We wish you joyful reading and a flight of fascinating discovery!  

 

Requirements

 

The software requirements to successfully run all the programs in this book are

 

     Operating System - Windows 2000

     .Net Framework SDK

     SQLServer 2000

 

 

Acknowledgements

 

I wish to thank a number of people who gave me their support, new ideas and inspiration while writing this book.

 

First and foremost, thanks to Manish Jain, BPB Publications for publishing the book.

 

Special thanks to my co-authors, Shruti and Sonal, who have put in their very best in the work assigned to them as without them and their efforts  the book would have never seen the light of day.

 

Thanks to Tanuja Sodhi, an ex-naval officer from the first batch of lady officers and an MBA from JBIMS for editing the book. She is presently freelancing as a creative writer.

 

Thanks to my cover designers, Altaf Hemani and Kishore Rohra, for designing the cover.

 

To Shivanand Shetty, who has always been there as a source of inspiration and encouragement.

 

A long list of friends need a mention here for their patience and cooperation on this book while it was being written.

 

 

 -Vijay Mukhi