|
XMLExpertise.com breaks down Schemas and Content Models
But what can you DO with XML ? As we mentioned in the introduction , you can build structures that represent a model of something in the world. This is what computers are for, to a great extent, and all programming systems provide some way of doing this. Layered on top of the idea of "structured data", we place the idea of "data that obeys adjustable constraints". These constraints are specified using Schemas or DTDs. The meaning of the word "schema" here is nearly identical to its use in the context of Relational DB systems. Consider an example situation where you want to manipulate information about your online customers. You know in advance some of the information you will want to collect and track - such as the customer's name, email address, and so forth. You will probably also want some room to adjust your model of this information in particular cases, and to add to the model as you go along. In order to keep your records manageable, you will want to make sure that you do not store unclearly formatted customer data, and it may be that without certain information - e.g. email address, the overall record is useless to you. Perhaps you would rather not let an employee store such a record. In a related example, you might want to be sure that a customer submitting a complicated order over the internet obeys certain rules in the way that they describe an order - e.g. "each line item must include a quantity, product name, unit price, and extended price". All of the hypothetical needs we just explored are addressed through use of XML Schemas and DTDs. These tools allow you to validate information without writing any software. You can simply "turn on" the validation feature of a parser, give it an XML schema and an XML document, and ask the parser to check that all the rules of the schema have been obeyed. If a rule is broken, the parser will give you a (hopefully) informative message which allows you, your customer, or someone else to fix the data. The use of schemas is a rather complex engineering task at present, requiring developers with experience in information modeling, as well as good engineering judgement about how to apply available tools and standards to achieve a particular real world objective. One graphical tool you can use to learn about this topic is called XMLAuthority . This program will read and write a number of different schema formats, and help you create XML models based on most kinds of XML, Java, Odbc, text, COM, or LDAP information you may have. To learn more about schemas in detail, you will want to read |