XML Schema Editor Features
XML Schema Editor has four main views to support creating, editing, and
browsing XML Schemas:
-
Content Outline View - work with XML Schema
contents in the context of the complete structure.
-
Design View - work on detailed level information
for an object.
-
Graph View - graphically browse the XML Schema structure.
-
Source View - view the XML Schema source.
In addition, it also uses the property sheet as
a secondary viewer for editing properties of the XML Schema.
Content Outline View
The Content Outline view displays the contents of the XML Schema as a tree
structure. Right mouse two on an object in the tree will show you the list
of actions that you can perform on a particular object.
On an XML Schema file object, you can:
-
Add Annotation. This action adds an annotation element to the XML Schema.
-
Add Global Element. This action adds a global element to the XML Schema.
-
Add Complex Type. This action adds a complex type. A complex type allow
elements in its content and may carry attributes.
-
Add Simple Type. This action adds a simple type. A simple type cannot have
element content and cannot carry attributes.
-
Add Attribute Group. This action adds an attribute group. An attribute
group contains a number of attributes, and can be referenced by multiple
definitions. It improves the readability and updatability of the schema.
-
Add Group. This action adds a global group to the XML Schema. A group contains
a number of elements, and can be used to build up the content model of
a complex type.
-
Add Include. This action adds an include element to the XML Schema. An
include element brings in definitions and declarations from another XML
Schema file. The target namespace of the included schema must be the same
as the target namespace of the current schema.
-
Add Import. This action adds an import element to the XML Schema. Similar
to an include element, an import element brings in definitions and declarations
from another XML Schema file, and they can also appear in different namespaces.
Note that the import elements themselves must appear as the first
children of the schema element.
On a Complex Type object, you can:
-
Add Annotation. This action adds an annotation element to the complex type.
-
Add Content Model. This action adds a sequence element to the complex type.
You can change it to a choice or a all element after it is added.
-
Add Group. This action adds a group element to the complex type.
-
Add Simple Content. This action adds a simple content to the complex type.
-
Add Complex Content. This action adds a complex content to the complex
type.
-
Add Attribute. This action adds an attribute to the content of the complex
type.
-
Add Attribute Group Ref. This action adds a reference to an attribute group.
This menu option only appears if there are attribute groups defined else
where in the document.
Note that both attribute declarations and attribute group
references must appear at the end of complex type definitions.
On a Simple Type object, you can:
-
Add Annotation. This action adds an annotation element to the simple type.
-
Add Restriction. This action adds a restriction element to the simple type.
-
Add Union. This action adds an union element to the simple type.
-
Add List. This action adds a list element to the simple type.
Depending on the type of the simple type, the following actions might apply:
-
Add Enum. This action adds an enumerator to the simple type. This menu
option only appears if the enumeration facet is applicable to the base
type of the simple type.
-
Add Pattern. This action adds a pattern to the simple type. This menu option
only appears if the pattern facet is applicable to the base type of the
simple type.
On a Attribute Group object, you can:
-
Add Annotation. This action adds an annotation element to the attribute
group.
-
Add Attribute. This action adds an attribute to the attribute group.
On a Content Model object, you can:
-
Add Group. This action adds a group element.
-
Add Group Ref. This action adds a reference to a global group.
-
Add Element. This action adds an element to the content of the complex
type.
-
Add Element Ref. This action adds a reference to a global element. This
menu option only appears if there are global elements defined else where
in the document.
On an Element or Global Element object, you can:
-
Add Annotaion. This action adds an annotation element to the element.
-
Add Unique. This action adds a unique element for indicating that an element
or attribute value must be unique within a certain scope.
-
Add Key. This action adds a key element.
-
Add Key Ref. This actions adds a reference to a key.
On an Annotation object, you can:
-
Add Documentation. This action adds a documentation element for storing
any human readable material.
-
Add AppInfo. The actions add add an appInfo element for storing information
for tools, stylesheets and other applications.
You can also use the Tree view to reorder the content model of a complex
type, or to reorder the sequence of global elements, complex types, groups
etc. in the XML Schema using drag and drop in the future.
Design View
When an object is selected in the Tree view, the Design view will show
the detailed information for that selected object. You can use the Design
view to edit the properties of a particular item, such as a complex type.
Element and Attribute Type
When you select an element, a global element, or an attribute, the Design
view allows you to specify its type information. An element type can reference
a complex type or a simple type. An attribute type must reference only
simple types.
Anonymous Type
An element or attribute can define its type to be anonymous. An anonymous
type can be useful if it is only referenced once and contain very few constraints.
You do not have to explicitly named or referenced an anonymous type.
To specify that an element's type is anonymous, when the User-defined
Simple Type or User-defined Complex Type is selected, choose the**anonymous**
item in the combo-box. You can then start adding the content to the new
anonymous type (simple or complex) that is added to the tree.
To specify that an attribute's type is anonymous, when User-defined
Simple Type is selected, choose the**anonymous** item in the combo-box.
You can then start updating the anonymous simple type that is added to
the tree.
Property Sheet
Some schema elements have a lot of properties. For example, the schema
element has properties such as attributeFormDefault and elementFormDefault.
They are not shown directly in the Design View as they are considered less
important to the design of the overall schema. If the user needs to edit
these properties, they can use the Property Sheet to update the value.
To bring up the Property Sheet, select Perspective->Basic->Properties.
When an object is selected in the Content Outline view, the additional
properties for that object will be displayed in the Property Sheet and
the user can update its value.
Graph View - (future release)
The Graph View provides a graphical view of the relationships between a
complex type and its content. You can expand or collapse any branch by
clicking on the + or - sign associated with a node. You can also
double click to position the Tree view to a particular element and go to
the Design View for that element.
Source View
At any time, you can switch to the Source View to review the resultant
XSD. When you select an object (say a complex type) in the Content Outline
view, its content block in the source view will be marked by a marker in
the vertical ruler on the left. You cannot edit the source from this view.
Menu Actions
The XML Schema Editor menu contains the following actions:
-
Generate DTD. Generates a .dtd file for the XML Schema. Schema specific
data that cannot be represented in a DTD will be skipped in the resultant
DTD.
-
Generate Java beans. Generates a set of
Java beans to wrap the DOM.
-
Generate HTML form. Generates a default HTML form (future release).
-
Validate XSD. Determines whether the current state of the XSD is semantically
valid based on the schema DTDs. Errors will be displayed into the Task
View.