Chapter 3 Building XML Models
The General tab contains the following properties:
The General tab of an XSD or DTD element property sheet displays the following properties (for XDR element properties, see the subsequent table):
Property | Description |
---|---|
Name | The name of the item which should be clear and meaningful, and should convey the item's purpose to non-technical users |
Code | The technical name of the item used for generating code or scripts, which may be abbreviated, and should not generally include spaces |
Comment | Descriptive label of the element |
Stereotype | Sub-classification used to extend the semantics of an object without changing its structure. It can be predefined or user-defined |
Reference | Name of a global element. The current element will have the same properties as the global element. The Reference property is only available for child elements. Use the list to select a global element in the current model, or the Browse tool to select a global element from any open model. If you select a global element from another model, a shortcut is created with the referencing element. When you define a reference, name and code properties are grayed. Name and code are those of the global element.
Once you have referenced an element, you can locate it in the diagram by right-clicking the referencing element symbol and selecting Find Referenced Element in the contextual menu. The referenced element is displayed with handles in the diagram. |
Group type | Specifies that the element has child elements, and how they are used. You can choose between:
|
Type | Element data type. Use the list to select a built-in data type. Use the Browse tool to select a simple or a complex type from any model opened in the current workspace. In the case of an XSD, selecting a data type will delete any group particle (and its child elements) or attribute previously defined in the element property sheet. Do not select a data type if you want to define attributes or child elements within the current element |
Embedded type | [XSD only] Locally defined data type. It applies to the current element only. Automatically set to Complex if you define a derivation for the element data type. |
Content | [XSD only] Content type of the element. If you select Complex, the element can have child elements. If you select Simple, the element cannot have child elements. |
Derivation | [XSD only] Derivation method for the element data type. Used to extend or restrict the values of the element data type. When you define a derivation, the data type disappears. You must click Apply and then the Properties tool to select a base type in the derivation property sheet. See Derivations: Extensions, Restrictions, Lists and Unions (XSM). |
In a model targeted with the XML-Data Reduced language, elements are defined by different attributes:
XDR element attribute | Description |
---|---|
Model | Specifies if an element can contain new local elements. Possible values are:
Tab: N/A |
Content | Specifies the content type. Possible values are:
Tab: General Field: Group type, Type |
Order | Specifies how child elements are organized within a parent element. Possible values are:
Tab: General Field: Group type |
dt:type | Specifies a data type.
Tab: General Field: Type |
dt:values | Specifies a list of possible element values.
Tab: Values |
type | [local elements only] Specifies the name of a global element as reference for the local element
Tab: General Field: Reference |
minOccurs | [local elements only] To specify the minimum number of occurrences for a local element. Usually set to 0 or 1
Tab: Detail Field: Minimum |
maxOccurs | [local elements only] To specify the maximum number of occurrences for a local element. Usually set to 1 or * (unbounded)
Tab: General Field: Maximum |
Example of an XDR file:
Copyright (C) 2007. Sybase Inc. All rights reserved. |
![]() |