August 2003
Intermediate to advanced
624 pages
15h 3m
English
It is very common to see restrictions on the length of string Elements. To avoid truncating alphanumeric values before inserting them into a database, some programmers create schemas that make sure no one can use a string long enough to be truncated. To restrict our column lengths we can create a String1024Type type derived from string, as follows.
<xs:simpleType name="String1024Type">
<xs:annotation>
<xs:documentation>This user-defined type shows how we
restrict our columns to 1024 characters
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:maxLength value="1024"/>
</xs:restriction>
</xs:simpleType>
|
We use the xs:simpleType Element with its name ...