Source (XML):
<xsd:simpleType name="myInteger">
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="10000"/>
<xsd:maxInclusive value="99999"/>
<xsd:restriction base="xsd:string">
<xsd:pattern
value="\d{3}-[A-Z]{2}"/>
<xsd:simpleType
name="USState">
<xsd:restriction base="xsd:string">
<xsd:simpleType
name="listOfMyIntType">
<xsd:list itemType="myInteger"/>
<xsd:simpleType
name="USStateList">
<xsd:list
itemType="USState"/>
<xsd:simpleType
name="SixUSStates">
<xsd:restriction
base="USStateList">
<xsd:simpleType
name="zipUnion">
<xsd:union memberTypes="USState listOfMyIntType"/>
<?xml
version="1.0" encoding="UTF-8"?>
<kdm:Segment xmi:version="2.1"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:code="http://kdm.omg.org/code"
xmlns:data="http://kdm.omg.org/data"
xmlns:kdm="http://kdm.omg.org/kdm"
name="XML
Simple Content Example">
<model xmi:id="id.0"
xmi:type="data:DataModel">
<dataElement xmi:id="id.1"
xmi:type="data:XMLSchema"
name="SimpleType examples">
<contentElement
xmi:id="id.2" xmi:type="data:SimpleContentType"
name="MyInteger" type="id.18"
kind="restiction">
<contentElement
xmi:id="id.3" xmi:type="data:ContentRestriction"
kind="minInclusive"
value="10000"/>
<contentElement
xmi:id="id.4" xmi:type="data:ContentRestriction"
kind="maxInclusive"
value="99999"/>
</contentElement>
<contentElement
xmi:id="id.5" xmi:type="data:SimpleContentType"
name="SKU" type="id.20" kind="restriction">
<contentElement
xmi:id="id.6" xmi:type="data:ContentRestriction"
kind="pattern" value=""\d{3}-[A-Z]{2}""/>
</contentElement>
<contentElement
xmi:id="id.7" xmi:type="data:SimpleContentType"
name="USState" kind="">
<contentElement
xmi:id="id.8" xmi:type="data:ContentRestriction"
kind="enumeration" value=""AK""/>
<contentElement
xmi:id="id.9" xmi:type="data:ContentRestriction"
kind="enumeration" value=""
<contentElement
xmi:id="id.10" xmi:type="data:ContentRestriction"
kind="enumeration" value=""AR""/>
</contentElement>
<contentElement
xmi:id="id.11" xmi:type="data:SimpleContentType"
name="listOfMyIntType"
type="id.2" kind="list"/>
<contentElement
xmi:id="id.12" xmi:type="data:SimpleContentType"
name="USStateList" type="id.7"
kind="list"/>
<contentElement
xmi:id="id.13" xmi:type="data:SimpleContentType"
name="SixUSStates"
type="id.12">
<dataRelation
xmi:id="id.14" xmi:type="data:RestrictionOf"
to="id.12" from="id.13"/>
<contentElement
xmi:id="id.15" xmi:type="data:ContentRestriction"
kind="length" value="6"/>
</contentElement>
<contentElement
xmi:id="id.16" xmi:type="data:SimpleContentType"
name="zipUnion" type="id.11 id.7"
kind="union"/>
</dataElement>
<dataElement
xmi:id="id.17" xmi:type="data:XMLSchema"
name="xsd">
<contentElement
xmi:id="id.18" xmi:type="data:SimpleContentType"
name="xsd:Integer">
<dataRelation
xmi:id="id.19" xmi:type="data:DatatypeOf"
to="id.32" from="id.18"/>
</contentElement>
<contentElement
xmi:id="id.20" xmi:type="data:SimpleContentType"
name="xsd:String">
<dataRelation
xmi:id="id.21" xmi:type="data:DatatypeOf"
to="id.33" from="id.20"/>
</contentElement>
<contentElement
xmi:id="id.22" xmi:type="data:SimpleContentType"
name="xsd:Decimal">
<dataRelation
xmi:id="id.23" xmi:type="data:DatatypeOf"
to="id.34" from="id.22"/>
</contentElement>
<contentElement
xmi:id="id.24" xmi:type="data:SimpleContentType"
name="xsd:positiveInteger">
<dataRelation
xmi:id="id.25" xmi:type="data:DatatypeOf"
to="id.32" from="id.24"/>
</contentElement>
<contentElement xmi:id="id.26" xmi:type="data:SimpleContentType" name="xsd:date">
<dataRelation
xmi:id="id.27" xmi:type="data:DatatypeOf"
to="id.35" from="id.26"/>
</contentElement>
<contentElement
xmi:id="id.28" xmi:type="data:SimpleContentType"
name="xsd:any"/>
<contentElement
xmi:id="id.29" xmi:type="data:SimpleContentType"
name="xsd:NMTOKEN"/>
</dataElement>
</model>
<model xmi:id="id.30" xmi:type="code:CodeModel">
<codeElement
xmi:id="id.31" xmi:type="code:LanguageUnit">
<codeElement
xmi:id="id.32" xmi:type="code:IntegerType"
name="xsd integer"/>
<codeElement
xmi:id="id.33" xmi:type="code:StringType"
name="xsd string"/>
<codeElement
xmi:id="id.34" xmi:type="code:DecimalType"
name="xsd decimal"/>
<codeElement
xmi:id="id.35" xmi:type="code:DateType"
name="xsd date"/>
</codeElement>
</model>
</kdm:Segment>