
In the Data Types Editor (DTE), you can open any XSD file from your workspace and manage its content. You can edit the data types in one namespace at a time, define the relationship between them and reuse them in the XSD schema that you open for editing. You can later reuse the XSD schema or specific data types defined in it. Those types can later be imported by other XML schema documents or WSDL documents. You can also change a global element of anonymous type to global type. The new structure types contains all the contents of the anonymous element, thus allowing you to reuse global element types. On the other hand, you can refactor global elements with global type into global elements with anonymous type for further editing. In case the global element with global structure type has children, you can choose whether to copy the contents of the structure type and use them as contents of the new global element with anonymous type.
Optionally, you can edit the XML schema directly in the dedicated Source section of the editor. If you create an XSD file form scratch, you need to define its namespace and add data objects and other elements.
You can use the context menu of the attributes to add new ones, delete an attribute, or copy and paste data types within a namespace.
In the Service Interface Editor (SIE), you can rename the target namespace of a definition or a types schema. For more information, see Editing Service Interfaces .
Using the DTE, you can:
Create new data types of simple and structure type.
Add global elements.
Change anonymous global elements to global elements with global types
Change global elements with global types to elements with anonymous types
Add elements and attributes.
Edit the details of each data type, change the base type and define constraints for simple types.
Add and delete elements.
Edit the source code.
You need to either:
Create a new XSD file.
or
Open an existing XSD file stored in your workspace.
Creating an XSD File
From the menu path, choose . Expand the node and choose XML Schema .
In the dialog that appears specify the details for the file that you want to create.
Select the development component and the exact folder in which you want to store the new service interface. Optionally, you can change the XSDfile default name. Choose the Next pushbutton.
Optionally, you can choose the Advanced pushbutton and link your XML file to another file in the file system.
Choose the Finish pushbutton.
Adding Simple and Structure Types
You can create simple types of primitive type or simple types derived from any other simple type that you may later use to define elements or attributes. You can also create structure types with one or more element and attributes.
Open the XSD file where you want to add a new simple type by opening the context menu and navigating to . Choose the Add Simple Type pushbutton or select it from the context menu..
You can do the following:
Specify an appropriate name for the simple type you added.
The DTE defines a default name for your new simple type. In case you define an invalid name, i.e. it is duplicated, an error marker is displayed. You can see a description of the error in the Problems view of the Developer Studio.
Change the base type by choosing from the list of primitive types in the dropdown menu.
Change the base type by choosing the Browse pushbutton. You can
Choose from the list of the types contained in the current XSD schema
Filter your search scope by choosing whether you want to search for types in your opened file ( Current Resource ), all XSD schemas and WSDL files in the current project ( Enclosed Project ) or in the whole workspace ( Workspace ). You can also search in workspaces you previously created.
Create a new type by choosing the New pushbutton. Enter a valid and unique name for the data type or element.
In the Documentation field, add any information about the data type that you want the user to see.
Optionally, you can define constraints for the new simple type. Possible constraints vary, depending on the base type.
To add a new structure type, choose the Add Structure Type pushbutton and define a valid name for the type.
You can now add attributes and elements to your structure type.
Adding Elements and Attributes
You can create new elements and attributes of simple or structure type and then add them to another structure type.
To add a new attribute, choose the Add Attribute pushbutton (or select this action from the context menu) and define a valid name.
To add a new element, choose the Add Element pushbutton (or select this action from the context menu) and define a valid name.
You can do the following:
Change the type by choosing from the list in the dropdown menu.
Change the type by choosing the Browse pushbutton. You can:
Choose from the list of the types contained in the current XSD schema.
Filter your search scope by choosing whether you want to search for types in your opened file ( Current Resource ), all XSD schemas and WSDL files in the current project ( Enclosed Project ) or in the whole workspace ( Workspace ). You can also search in workspaces you previously created.
Create a new type by choosing the New pushbutton. Enter a valid and unique name for the data type or element.
Depending on the type of the element, you can edit its cardinality or nillability.
In the Documentation field, add any information about the data type that you want the user to see.
Optionally, you can define constraints for the elements or attributes of simple type. Possible constraints vary, depending on the type.
When you put constraints on elements or attributes of simple type, they automatically become anonymous.
Adding Global Elements
You can create new global element and later reuse it in other structures, schemas or elements that refer to it. When you create a new global element, its type it is anonymous by default. When another structure or element refers to this global element, structure of the global element is displayed in the tree as read-only.
To add a new element, choose the Add Global Element pushbutton. The element is anonymous by default.
2. To change the type of the global element, choose the Browse pushbutton. You can:
Choose from the list of the global types contained in the current XSD schema.
Filter your search scope by choosing whether you want to search for types in your opened file ( Current Resource ), all XSD schemas and WSDL files in the current project ( Enclosed Project ) or in the whole workspace ( Workspace ). You can also search in workspaces you previously created.
Refactoring Global Elements
To change a global element with anonymous type to a global element with global type, select it in the tree. From the context menu, choose .
A new structure type is created with the contents of the global element prior to the change. The new type of the element is the newly created structure type.
To change a global element with global type to a global element with anonymous type, select it in the tree. From the context menu, choose .
The element type is changed to anonymous. You can now add child elements and attributes.
To convert a global element with global structure type to an element with an anonymous type containing the structure type contents in the new element contents, select it in the tree. From the context menu, choose Convert to Anonymous Type with Type Contents .
The element type is changed to anonymous and the contents of the old structure type are copied and used as the new element contents.
Creating New Data Types
You can easily create new data types by choosing the New pushbutton (or select this action from the context menu) and editing its details.
Removing Elements and Data Types
You can easily delete any data type or element by selecting it and choosing the Remove pushbutton or from the context menu..
In case you delete an element, referenced by another element or structure, the second element becomes invalid and an error marker is displayed. To see a description of the error, open the Problems view of the Developer Studio.
Copying Elements and Data Types
Using the SIE, you can easily copy data types and elements to other namespaces. For more information, see Managing Service Interfaces .
Managing Imported Types
When you model a type by using a type, defined in another XSD schema, the schema is automatically imported and displayed in the Imported node at the end of the tree. The data types in the imported schema are read-only. To edit an imported data type according to your needs, copy it in one of the elements or structures in your XSD file.