The schema can be edited using drag and drop operations or contextual menu actions.
Drag and drop action 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.
If this property has not been set, you can easily set the attribute/element type by dragging
over it a simple type or complex type from the diagram. If the type property for a simple type
or complex type is not already set, you can set it by dragging over it a simple or complex
type.
Depending on the drop area, different actions are available:
- move - Context dependent, the selected component is moved to the
destination;
- refer - Context dependent, the selected component is referred from the
parent;
- copy - If
(Ctrl) key is pressed, a copy of the selected component
is inserted 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 by double clicking 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 in the
Preferences.
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 is
displayed in the list as componentName#targetNamespace. If the reference is
from a target namespace which was not yet mapped, you are prompted to add prefix mappings for
the inserted component namespace in the current edited schema.
You can also change the compositor by double-clicking 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 is displayed, allowing you to customize the directives.
The contextual menu of the Design mode 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 the arrow
displayed in its bottom right corner.
-
Open Schema (
(Ctrl - Shift - Enter)) - Opens the selected schema. This
action is available for xsd:import, xsd:include and
xsd:redefine elements. If the file you try to open does not exist, a
warning message is displayed and you have the possibility to create the file.
- Edit Attributes... (Alt - Shift
- 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 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 or identity constraints (unique, key,
keyref). You can set a name for a named component after it was added in
the diagram.
- Insert before - Inserts before the selected component in the
schema. The list of components that can be inserted depends on the context. For example,
before an xsd:import you can insert an xsd:import,
xsd:include or xsd:redefine. You can set a name for a
named component after it was added in the diagram.
- Insert after - Inserts a component after the selected component on
the schema. The list of components that can be inserted depends on the context. You can set
a name for a named component after it was added in the diagram.
- 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
xsd:include or xsd:redefine element. See the
Edit Import dialog for more details.
Note: If the imported file has
declared a target namespace, the field Namespace is completed
automatically.
- Edit Schema Namespaces... - When performed on the schema root, it
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.
- 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 pressing 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: 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: Annotations are
rendered by default under the graphical representation of the component. When you have a
reference to a component with annotations, these annotations are presented in the diagram
also below the reference component. The Edit Annotations action
invoked from the contextual menu 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 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 is replaced with a reference to the global element. The
local element properties that are also valid for the global element declaration are
kept.
Extracting a Global Element
If you execute
Extract Global Element on element
name, the result is:
- 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.
Extracting a Global Attribute
If you execute
Extract Global Attribute on attribute
note the result is:
- 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 parent of the compositor is not a group.
If you execute Extract Global Group on the sequence element, the
Extract Global Component dialog is shown and you can choose a
name for the group. If you type personGroup, the result is:
Extracting a Global Group
- 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.
Extracting a Global Simple Type
If you use the action on the
union component and choose
numericST for the new global simple type name, the result is:
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 is:
- Rename Component - Rename the selected component.
Cut (Ctrl -
X) - Cut the selected component(s).
Copy (Ctrl -
C) - Copy the selected component(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 is 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.
- Search References in... - Searches all references of the item found
at current cursor position in the specified scope.
- Search Occurrences in File - Searches all occurrences of the item
found at current cursor position in the current file.
-
Component Dependencies -
Allows you to see the dependencies for the current selected component.
- Resource Hierarchy - Allows you to see the hierarchy for the
current selected resource.
- Resource Dependencies - Allows you to see the dependencies for the
current selected resource.
Expand all - Expands
recursively all sub-components of the selected component.
Collapse all - Collapses
recursively all sub-components of the selected component.
- Save as Image... - Save the diagram as image, in JPEG, BMP, SVG or
PNG format.
Generate Sample XML Files
- Generate XML files using the current opened schema. The selected component is the XML
document root. See more in the Generate
Sample XML Files section.
Options... - Show the
Schema preferences panel.