Schema Examples

As we discussed in Chapter 6, schemas are optional in our approach. We can successfully run the utilities without them. However, if we want to be sure that certain business constraints are enforced, such as making specific fields mandatory, schemas are required. Schema validation is the mechanism we have chosen to enforce those constraints. In Chapter 6 I talked about an approach for designing these schemas. The basic recommendation is to take an instance document of the desired type, such as an invoice or purchase order, load it into a tool like XMLSPY, and have the tool create the schema. Here we'll review some schemas for our sample documents, the invoice and purchase order.

In this book I'm trying, for the most part, to avoid ...

Get Using XML with Legacy Business Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.