Home >Online Product Documentation >Table of Contents >Defining Elements That Carry Attributes and Contain Data in XML Schemas
You might want to define an element that carries attributes and contains data, but does not contain subelements. In the purchaseOrder.xsd document, an example of this is the internationalPrice element, shown here in the Diagram tab.
purchaseOrder.xsd
internationalPrice
This element has a currency attribute, and it contains data based on the xsd:decimal simpleType.
currency
xsd:decimal
schema
Alternatives: This operation is also available from the XMLSchema > Diagram > Add > Element menu and from the Add button .
The new element is added to the XML Schema. It is displayed in the diagram and in the text pane (if you have it open). The properties for the new element are displayed in the Properties window.
The Type Derivation dialog box appears.
The XML Schema is updated with the element's new definition. Figure 265 shows an extension of the decimal simpleType.
decimal
The simpleContent node ( ) specifies that the complexType can contain only data and attributes. It cannot contain subelements.
Stylus Studio displays a scrollable, drop-down list of the simpleTypes built in to XML Schema and previously defined in the current schema.
If you clicked New Restriction, follow these steps:
Default
Fixed Value