The Important Aspect of XML Schema1. XML schemas provide innumerable benefits to a development environment. Many of these benefits are intangible or economic in nature, indirectly increasing productivity and decreasing time-to-market. The most important tangible aspect of an XML schema is that an XML schema specifies a contract between software applications or between parts of a software application.
2. A developer creating software to generate XML, or an unfortunate employee who has to manually create XML, knows the target. A developer writing software that receives the XML not only knows what to expect, but can validate the incoming XML against the schema. As a specification of an interface, an XML schema might not be as easy to read as an English document, but it is incredibly precise. Furthermore, the writer can clarify the intent of a schema with XML comments and XML schema annotations each with embedded English or any other language
3. For software development shops creating large applications, the notion of a contract simplifies modularization, resource allocation, testing, and deployment. Modularizing the code is easier because the boundaries are readily identifiable (each boundary is an XML document). This in turn makes resource allocation easier: Individual developers receive specific tasks, each of which has well-defined inputs and outputs.
4. Testing is also much easier: The developer generating XML ensures that the generated XML validates against the XML schema, and the developer receiving the XML can easily create test XML documents in a common editor. Subsequently, integration testing is usually far more successful than with traditional data (such as passing objects and structures). Finally, even deployment is simpler: Versions of code that generate the XML can be deployed at different times than code that receives the XML assuming that the schema is stable.
5. Modern distributed environments compound the issues just mentioned for a development shop. In particular, the developer writing software to process XML might be writing a Web service; anyone on the Internet could potentially generate XML that is sent to the Web service. In the case of a Web service, the XML schema is the crucial piece of documentation. Likewise, the XML schema is the contract by which everyone abides. For example, the developer can change the underlying Web service as long as the XML schema does not change. Likewise, developers know the exact target required by the XML schema.