Think of a schema as a blueprint for an XML document. A valid XML document is an
instance of a the schema it refers to. The anology is parallel to the relation between a class definition and an instance of that class. More than one XML document can be valid for any given schema.
Since schema defines the structure of a XML document, they can be used to verify the correctness of a XML document received from an external source. This is where adoption of XML technology imparts a tremendous value addition to B2B transactions. In a typical supply-chain management, the supplier receives requests from clients for consumables( either durables or services ). The B2B paradigm automates the order processing and fullfilment cycle between a number of such supplier-consumer entities.
Eventhough in a perfect world all the actors ( suppliers, managers, consumers etc. ) involved in in the business process speak the same language, the reality is painfully different. Due to lack of standardization of data
exchange formats, order requests can come in a zillion different shapes and sizes - ranging from simple predefined fill-in form to e-mail or even verbal requests. The promise of XML technology as a universally standard language greatly alleviates the need to use translation modules to decipher proprietary formats.
This is where the Schema definition kicks in. Using XML for data interchange is not a silver bullet. It is not a cure all and infact increase the complexity of managing and making sense out of data, if the structure of XML itself is not standaradized. Since XML allows user-defined tags, vendors are free to create and use anything of their choice. Since the use of XML Schema removes all such ambiguities and enforces constraints on the structure of an XML document, vendors can now agree upon industry-specific document structures for exchanging information. Once agreed upon, these structures( Schema ) can be published as public resources and any validating parser will be able to validate an XML document with reference to the schema.
Hope I have answered your question.
Good luck,
------------------
Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.