Built-in Transformations - XSD Transformation
The purpose of the XSD Transformation is to convert Platform-Independent Model (PIM) elements to UML Profile for XML elements as an intermediary step to creating an XML Schema. Each selected PIM class element is converted to a <<XSDcomplexType>> element.
For more information, see XML Schema Generation.
From our standard PIM
We Transform to:
Which in turn generates the XSD below:
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
|
<xs:element name="Account" type="Account"/>
|
|
<xs:complexType name="Account">
|
|
<xs:element name="name" type="xs:string"/>
|
|
<xs:element name="billingAddress" type="xs:string"/>
|
|
<xs:element name="emailAddress" type="xs:string"/>
|
|
<xs:element name="closed" type="xs:boolean"/>
|
|
<xs:element name="deliveryAddress" type="xs:string"/>
|
|
<xs:element ref="Order"/>
|
|
<xs:element ref="ShoppingBasket"/>
|
|
<xs:element name="LineItem" type="LineItem"/>
|
|
<xs:complexType name="LineItem">
|
|
<xs:element name="quantity" type="xs:integer"/>
|
|
<xs:element ref="StockItem"/>
|
|
<xs:element name="Order" type="Order"/>
|
|
<xs:complexType name="Order">
|
|
<xs:element name="date" type="xs:date"/>
|
|
<xs:element name="deliveryInstructions" type="xs:string"/>
|
|
<xs:element name="orderNumber" type="xs:string"/>
|
|
<xs:element ref="LineItem"/>
|
|
<xs:element name="status" type="OrderStatus"/>
|
|
<xs:simpleType name="OrderStatus">
|
|
<xs:restriction base="xs:string">
|
|
<xs:enumeration value="new"/>
|
|
<xs:enumeration value="packed"/>
|
|
<xs:enumeration value="dispatched"/>
|
|
<xs:enumeration value="delivered"/>
|
|
<xs:enumeration value="closed"/>
|
|
<xs:element name="ShoppingBasket" type="ShoppingBasket"/>
|
|
<xs:complexType name="ShoppingBasket">
|
|
<xs:element ref="LineItem"/>
|
|
<xs:element name="StockItem" type="StockItem"/>
|
|
<xs:complexType name="StockItem">
|
|
<xs:element name="catalogNumber" type="xs:string"/>
|
|
<xs:element name="Transaction" type="Transaction"/>
|
|
<xs:complexType name="Transaction">
|
|
<xs:element name="date" type="xs:date"/>
|
|
<xs:element name="orderNumber" type="xs:string"/>
|
|
<xs:element ref="Account"/>
|
|
<xs:element ref="LineItem"/>
|