Schema editing actions

The schema can be edited using drag and drop operations or contextual menu actions.

Drag and drop provides the easiest way to move the existing components to other locations in the schema. For example an element reference can be quickly inserted in the diagram with a drag and drop from the Outline view to a compositor in the diagram. Also the components order in an xs:sequence can be easily changed using drag and drop. You can easily set the an attribute/element type if this property has not been set by dragging a simple or complex type from the diagram over it. Also you can set the type property for a simple or complex type if the property is not already set by dragging a simple or complex type over it. The type of the mouse pointer will indicate the action which will be performed after drag and drop. Depending on the drop context, the dragged element will be either moved as a child of the drop parent or referred from the parent. If Ctrl is pressed, the component will be copied to the destination.

You can edit some schema components directly in the diagram. For these components you can edit the name and the additional properties presented in the diagram. To do this just double click on the value you want to edit. If you want to edit the name of a selected component you can also press Enter. The list of properties which can be displayed for each component can be customized here. When editing references, you can choose from a list of available components. Components from an imported schema for which the target namespace does not have an associated prefix will be displayed as componentName#targetNamespace in the list. If the reference is from a target namespace which was not yet mapped you will be prompted to add prefix mappings for the inserted component namespace in the current edited schema.

You can also change the compositor by double-click on it and choose the compositor you want from the proposals list.

There are some components that cannot be edited directly in the diagram: imports, includes, redefines. The editing action can be performed if you double-click or press Enter on an import/include/redefine component. An edit dialog will appear allowing you to customize the directives.

The contextual menu of the Design page offers the following edit actions:

Show Definition (Ctrl-Shift-Enter)

Shows the definition for the current selected component. For references this action is available by clicking on the arrow displayed in its bottom right corner.

Open Schema (Ctrl-Shift-Enter)

Open the selected schema. This action is available for imports, includes and redefines. If the file you try to open does not exist, a warning message will be displayed and you have the possibility to create the file.

Edit Attributes... (Alt+Enter)

Allows you to edit the attributes of the selected component in a dialog that presents the same attributes as in the Attributes View and in the Facets View. The actions that can be performed on attributes in this dialog are the same actions presented in the two views.

Append child

Offers a list of valid components to append depending on the context. For example to a complex type you can append a compositor, a group, attributes, identity constraints (unique, key, keyref). After a named component was added in the diagram you can set a name for it.

Insert before

Inserts before the selected component in the schema. The components to be inserted depend on the context. For example, before an import you can insert an import, an include or a redefine. After a named component was added in the diagram you can set a name for it.

Insert after

Inserts a component after the selected component on the schema. The components to be inserted depend on the context. After a named component was added in the diagram you can set a name for it.

New global

Inserts a global component in the schema diagram. This action does not depend on the current context.

If you choose to insert an import you have to specify the url of the imported file, the target namespace and the import id. The same information, excluding the target namespace, is requested for an include or redefine.See the Edit Import dialog for more details

[Note]Note

If the imported file has declared a target namespace, the field Namespace will be filled automatically.

Edit Namespaces...

When performed on the schema root allows you to edit the schema Target namespace and namespace mappings. You can also invoke the action by double-clicking the target namespace property from Attributes View for the schema or by double-clicking the schema component. For details see the Edit Schema Namespaces dialog .

 Edit Annotations...

Allows you to edit the annotation for the selected schema component in the Edit Annotations dialog.

You can perform the following operations in the dialog:

  • Edit all appinfo/documentation items for a specific annotation. All appinfo/documentation items for a specific annotation are presented in a table and can be easily edited. Information about an annotation item includes: type(documentation/appinfo), content, source(optional, specify the source of the documentation/appinfo element) and xml:lang. The content of a documentation/appinfo item can be edited in the Content area below the table.

  • Insert/Insert before/Remove documentation/appinfo. allows you to insert a new annotation item (documentation/appinfo). You can add a new item before the item selected in table by press the button. Also you can delete the selected item using the button.

  • Move items up/down To do this use the and buttons.

  • Insert/Insert before/Remove annotation. Available for components that allow multiple annotations like schemas or redefines.

  • Specify an ID for the component annotation. The ID is optional.

[Note]Note

For imported/included components which do not belong to the current edited schema the dialog presents the annotation as read-only and you will have to open the schema where the component is defined in order to edit its annotation.

[Note]Note

Annotations are by default rendered under the component's graphical representation. When you have a reference to a component with annotations, these annotations will be presented in the diagram also below the reference component. The Edit Annotations action invoked from the contextual menu will edit the annotations for the reference. If the reference component does not have annotations you can edit the annotations of the referred component by double-clicking on the annotations area. Otherwise you can edit the referred component annotations only if you go to the definition of the component.

Extract Global Element

Action available for local elements. A local element is made global and will be replaced with a reference to the global element.

The local element properties that are also valid for the global element declaration are kept.

 

Example 4.6. Extracting a global element

If you execute Extract Global Element on element name, the result will be:


Extract Global Attribute

Action available for local attributes. A local attribute is made global and replaced with a reference to the global attribute.

The properties of local attribute that are also valid in the global attribute declaration are kept.

 

Example 4.7. Extracting a global attribute

If you execute Extract Global Attribute on attribute note, the result will be:


Extract Global Group

Action available for compositors (sequence, choice, all). This action extracts a global group and makes a reference to it. The action is enabled only if the compositor's parent is not a group.

 

Example 4.8. Extracting a global group

If you execute Extract Global Group on the sequence, the Extract Global component dialog is shown and you can choose a name for the group.

If you type personGroup, the result will be:


Extract Global Type

Action used to extract an anonymous simple type or an anonymous complex type as global. For anonymous complex types the action is available on the parent element.

 

Example 4.9. Extracting a global simple type

If you use the action on the union and choose numericST for the new global simple type name, the result will be:


 

Example 4.10. Extracting a global complex type

If you execute the action on element person, and choose person_type for the new complex type name, the result will be:


Rename Component

Rename the selected component. Click here for more details.

Cut (Ctrl-X)

Cut the selected component(s).

Copy (Ctrl-C)

Copy the selected components(s).

Paste (Ctrl-V)

Paste the component(s) from the clipboard as children of the selected component.

Paste as Reference

Create references to the copied component(s). If not possible a warning message will be displayed.

Remove (Delete)

Remove the selected component(s).

Optional

Can be performed on element/attribute/group references, local attributes, elements, compositors and element wildcards. The minOccurs property is set to 0 and the use property for attributes is set to optional.

Unbounded

Can be performed on element/attribute/group references, local attributes, elements, compositors and element wildcards. The maxOccurs property is set to unbounded and the use property for attributes is set to required.

Search

Can be performed on local elements or attributes. This action makes a reference to a global element or attribute.

Search References

Searches all references of the item found at current cursor position in the defined scope if any. Click here for more details.

Search References in...

Searches all references of the item found at current cursor position in the specified scope. Click here for more details.

Search Occurrences in File

Searches all occurrences of the item found at current cursor position in the current file. Click here for more details.

Component Dependencies

Allows you to easily see the dependencies for the current selected component. Click here for more details.

Resource Hierarchy

Allows you to easily see the hierarchy for the current selected resource. Click here for more details.

Resource Dependencies

Allows you to easily see the dependencies for the current selected resource. Click here for more details.

Save as Image...

Save the diagram as image.

Generate Sample XML Files

Generate XML files using the current opened schema. The selected component will be the XML document root. See more on Generate Sample XML Files section.

Options...

Show the Schema preferences panel.