Is this correct?
I am representing my database in an XML schema, but I am not just naming an
element=database field. But some of my IDs (i.e. USER_ID, and PROFILE_ID)
are not the same length in numbers. They are defined in the database as
NUMBERPS(2,0), NUMBERPS(3,0),...,NUMBERPS(8,0). Therefore in my complexTypes
should my ID/Identity fields use a simpleType with the limiting facets.
For example:
<xs:complexType name="application">
<xs:sequence>
<xs:element name="app_id" type="id4" />
<xs:element name="enabled_ind" type="indicator" />
<xs:element name="application_desc" type="xs:string"/>
<xs:element name="application_guid" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="id4">
<xs:restriction base="xs:int">
<xs:minInclusive value="1" />
<xs:totalDigits value="4" />
<xs:maxExclusive value="9999" />
</xs:restriction>
</xs:simpleType>
Is this good design, too restrictive, or what? My database cannot accept
something different, therefore I would assume, I should be strict.
--
Mike Logan