Complex Type with Sub-Properties

Variable Replacement Table

Variable Description Usage NDR Reference
{$Name} Name of the type Required NDR Section 10.2.1 General object types
Rule 7-5 How to name a component
NDR Section 10.8 Component naming rules
Rule 11-1 Type name ends in "Type"
Rule 11-2 Complex type name is upper camel case
{$Definition} The data definition of the type Required NDR Section 11.6.1 How to write component definitions
Rule 11-32 Standard opening phrase for complex types
{$Parent} QName of the parent type "structures:ObjectType" or other NIEM type Rule 10-2 Complex object types are derived from structures:ObjectType
{$ElementName} The QName of the element referenced Required, Line is repeatable NDR Section 11.3 Model group components
{$AttributeName} The QName of the attribute referenced. Note: Attributes are rarely used in NIEM. Line is repeatable
{$Min} The minimum number of times the element can occur within the type
{$Max} The maximum number of times the element can occur within the type

Complex Type

<xs:complexType name="{$Name}Type">
    <xs:annotation>
      <xs:documentation>A data type for a(n) {$Definition}</xs:documentation>   
    </xs:annotation>
    <xs:complexContent>
      <xs:extension base="{$Parent}">
        <xs:sequence>
            <xs:element ref="{$ElementName}" minOccurs="{$Min}" maxOccurs="{$Max}"/>
        </xs:sequence>
        <xs:attribute ref="{$AttributeName}" use="optional|required"/>
      </xs:extension>
    </xs:complexContent>
</xs:complexType>

Example