![]() |
Previous Top Next |
References, attributes and enumerations
|
1. | Switch to the Schema overview ![]() |
2. | Click on the component icon of the ![]() |
3. | Right click the Person element, and select Make Global | Element.
|
A small "link" icon appears in the Person element, showing that this element now references the globally declared "Person" element. The "isRef" field in the Details entry helper is set active.
|
4. | Click the "Display all Globals" icon ![]() |
The Person element is now also visible in the component list, as well as in the "Elm" tab of the Component navigator. Click the Elm tab to see the global elements.
|
![]() |
Please note:
|
Global declarations do not describe where an element is to be used in an XML document, they only describe what it contains. Global definitions have to be referenced from within a complex type, or another element, to determine their position in the XML document.
|
|
1. | Click the Person element to make it active.
|
2. | Click the Append icon, in the top left of the attribute tab (the lower window of the schema overview), and select the "Attribute" entry.
|
![]() |
3. | Enter "Manager" as the attribute name in Name field.
|
4. | Use the Type combo box to select "xs:boolean".
|
5. | Use the Use combo box to select "required".
|
![]() |
6. | Use the same method to:
|
Add a "Programmer" attribute in the Name field (type="xs:boolean), and set its Use to "optional".
|
1. | Click the Append icon in the top left of the attribute window, and select the "attribute" entry.
|
2. | Enter "Degree" as the attribute name, and select "xs:string" as the attribute type.
|
3. | Click the Enumerations tab of the Facets entry helper.
|
![]() |
4. | Click the Append icon ![]() |
5. | Use the same method to add two more items to the enumerations list ("MA" and "Ph.D").
|
The finished schema should look like this:
|
![]() |
6. | Select the menu command File | Save, and save the file as AddressLast.xsd.
|
|
Please note:
|
This schema is available as 'AddressLast.xsd' in the Tutorial folder.
|
|