Why cant we just declare a new type? I dont understand...
Could someone please help
"I may not have gone where I intended to go, but I think I have ended up where I needed to be"<br /> <br />"He felt that his whole life was some kind of dream and he sometimes wondered whose it was and whether they were enjoying it"<br /> <br />--by Douglas Adams<br /> <br />[SCJP - 96%, SCWCD - 88%, SCBCD - May 2008]
Based on my own experience (and others), I recommend that you have a basic set of fundamental types that you can compose to other types (structures, records) and sequences (arrays). Be careful with enumerations (an anachronism from the time when each byte did count - use strings instead), inheritance and polymorphism (even when XML supports it).
However the concept of restriction is supposed to help eliminate duplication from the schema.
Also restriction isn't inheritance in the polymorphic sense - i.e. you can't always use the derived type in place of the parent-type because the derived type is more constrained than the parent type. Restriction is used to create new types by placing additional constraints on an existing type - the existing type is often a base XML type. For example:
a lower case alpha string with at least 6 but no more than 8 letters