There are some basic rules a good XML Schema complies to. It all starts with thinking and documenting the general schema design pattern (the five are Russian Doll, Venetian Blind, Salami Slice, Garden of Eden and Bologna). It is a simple choice to make, and there is lots of information available on the net with the pros and cons for each choice. My personal favorite is the Garden of Eden and I recommend this for everyone considering building a corporate, domain or canonical datamodel based on XML technologies.
The second thing to really think about is namespace design. Good namespace design is practical and will work for you in understanding the domain you are talking about. Some guidelines I use when making my namespace design:
1) Make it urn based, not protocol based;
- Not OK: http://www.free-your-energy.nl/
- OK: urn:nl:free-your-energy:schema:data
2) Use the major version in your namespace, so no dates but major versions;
- Not OK: urn:nl:free-your-energy:schema:data
- Not OK: urn:nl:free-your-energy:schema:data:20090918
- OK: urn:nl:free-your-energy:schema:data:1
The upcoming weeks I will elaborate in detail on XML Schema design with more tips.