![]() |
Previous Top Next |
Globals, extending simple and complex types
|
1. | Right click the Address element, and select Make Global | Complex type.
|
The Address elements appear in a yellow box.
|
![]() |
2. | Click on the "Display all Globals" ![]() |
The schema overview now displays two global components: the Company element and the complexType "AddressType".
|
![]() |
Click on the Com(plex) tab of the Component Navigator to see that AddressType is also visible there.
|
3. | Click on the AddressType component icon ![]() |
![]() |
4. | Click the "Display all Globals" icon to return to the schema overview.
|
|
1. | Switch to the schema overview, if not already visible (Display all globals).
|
2. | Click the Append icon, at the top left of the component window.
|
3. | Select ComplexType from the context menu.
|
![]() |
A new line appears in the component list, and the cursor is set for you to enter the component name.
|
4. | Enter "US-Address" and confirm with Enter. (If you forget to enter the hyphen character "-", the element name will appear in red, signalling an illegal character.)
|
![]() |
5. | Click the US-Address component icon ![]() |
6. | Click the "base" combo box in the Details entry helper, and select the "AddressType" entry.
|
![]() |
The content model view changes immediately and displays the previously defined generic address.
|
![]() |
7. | Right click the US-Address element, and select Add Child | Sequence.
|
A new sequence compositor is displayed outside of the AddressType box. This is a visual indication that this is an extension to the element.
|
![]() |
8. | Right click the new sequence compositor, and select Add Child | Element.
|
9. | Name the element "Zip", and hit the "Tab" button.
|
10. | Select (or enter) xs:positiveInteger from the "type" field combo box, and confirm with Enter.
|
![]() |
1. | Switch to the Schema overview ![]() |
2. | Click the append icon, select SimpleType, and enter "US-State" as the element name (Enter to confirm).
|
3. | Select xs:string in the "restr." value field of the Details entry helper.
|
This completes the definition. This element can now be used in the US-Address definition.
|
![]() |
4. | Click the US-Address component icon ![]() |
5. | Enter "State" for the element name, and hit the "Tab" key.
|
6. | Select (or enter) "US-State" from the "type" combo box (click Enter to confirm).
|
![]() |
Please note:
|
Global simple types can only be created from the schema overview.
|
1. | Create the global complex type "UK-Address", with the base="AddressType"
|
2. | Add a new Postcode element to the content model of UK-Address.
|
Your UK-Address content model should finally look like this:
|
![]() |
|