Here are my definite sources for XML Schema Design:
Zero, One, or Many Namespaces?
W3C XML Schema: DOs and DON'Ts (Kohsuke)
Reference Model For XML Design (PDF)
W3C XML Schema Design Patterns: Avoiding Complexity (Obasanjo)
These all represent slightly different viewpoints.
For example, these are Obasanjo's guidelines altered from Kohsuke's:
Zero, One, or Many Namespaces?
W3C XML Schema: DOs and DON'Ts (Kohsuke)
Reference Model For XML Design (PDF)
W3C XML Schema Design Patterns: Avoiding Complexity (Obasanjo)
These all represent slightly different viewpoints.
For example, these are Obasanjo's guidelines altered from Kohsuke's:
I've altered some of Kohsuke's original guidelines:There are still some problems with extensions of complex types and validation. The problem is the need to have xsi:type attributes sprinkled in your XML documents. From a purist point of view, we should not really have validation artifacts in our XML tags.
I propose some additional guidelines as well:
- Do use element declarations, attribute groups, model groups, and simple types.
- Do use XML namespaces as much as possible. Learn the correct way to use them.
- Do not try to be a master of XML Schema. It would take months.
- Do
notuse complex types and attribute declarations.- Do not use notations
- Do
notuse local declarations.- Do
notcarefully use substitution groups.- Do
notcarefully use a schema without thetargetNamespace
attribute (aka chameleon schema.)
- Do favor key/keyref/unique over ID/IDREF for identity constraints.
- Do not use default or fixed values especially for types of xs:QName.
- Do not use type or group redefinition.
- Do use restriction and extension of simple types.
- Do use extension of complex types.
- Do carefully use restriction of complex types.
- Do carefully use abstract types.
- Do use elementFormDefault set to qualified and attributeFormDefault set to unqualified.
- Do use wildcards to provide well defined points of extensibility.
No comments:
Post a Comment