You can use the redefine mechanism to
redefine simple and complex types, groups, and attribute groups obtained
from external schema files. When you redefine a component, you are
modifying its contents.
Like the include mechanism, redefine requires
the external components to be in the same target namespace as the
redefining schema, although external components from schemas that
have no namespace can also be redefined.
The following instructions
were written for the Resource perspective, but they will also work
in many other perspectives.
To add a redefine element, complete
the following steps:
- Open your XML schema in the XML schema editor.
- In the Design view, right-click in the Directives section
and click Add Redefine.
- In the Select XML schema file wizard, you can import an
XML schema that is located in your workspace or you can import a schema
from an HTTP Web address. The XML schema file that you select must
have the same namespace as the current schema.
- If you want to import an XML schema located in your workspace:
- Select Workbench projects and click Next.
- Select the schema that you want to import and click Finish.
- If you want to import an XML schema located at an HTTP Web
address:
- Select HTTP and click Next.
- Type the URL of the XML schema and click Finish.
Note: A
local copy of the schema is not stored in your workspace. If you validate
your schema, the schema's contents are checked from the URL that you
specify.
- Optional: Use the Properties view to define
additional properties for your import element.
- If you want to edit the location of the included XML
schema file, click the General tab and type
the new location display in the Schema location field.
- Click the Documentation tab if
you want to provide any information about this redefine element.
The Documentation page is used for human
readable material, such as a description.
- Click the Extensions tab if you
want to add application information elements to your annotations of
schema components. The Extensions page
allows you to specify the schema and add XML content to your annotations.
Once you have added the redefine element to your XML schema,
you can redefine any of the simple and complex types, groups, and
attribute groups in the XML schema you selected in the redefine element.