Generate XSD

When you have developed your XML Schema model, either as an abstract Class model or a tailored XSD Class model, you can forward-engineer it into W3C XML Schema (XSD) files using the Generate XML Schema feature. As an XML Schema corresponds to a UML package in Enterprise Architect, XML Schema generation is a package-level operation.

You define the location of the file into which the XML Schema is to be generated, in the Schema Package element in your model.

Access    Project Browser | Click on source Package | Tools | XML Schema | Generate XML Schema, or
Project Browser | Right-click source Package | Code Engineering | Generate XML Schema

Generate Schema files

Field/Option/Button

Action

See also

Encoding

Either:

Click on the drop-down arrow and select the XML encoding scheme to use, or
Click on the Default button to apply the default encoding scheme (UTF-8)

 

 

Generate global element for all global ComplexTypes ('Garden of Eden' style)

 

Selected by default to generate Schema in the Garden of Eden style, containing a global element.

Clear the checkbox if you want to omit the global element.

Generate Global Element

Generate XSD for Referenced packages

 

Select the checkbox to generate Schema for packages that are referenced by any of the packages selected on this dialog.

 

Prompt when missing Filename

Select the checkbox to prompt, during Schema generation, for a filename for a referenced package if the path into which to generate the Schema file is missing.

This option is not available if the Generate XSD for Referenced packages option is not selected.

 

 

Use relative-path to reference XSDs  (if 'schemaLocation' tag is empty)

Select the checkbox to use a relative-path in the XSD import (or XSD include) statement when referencing external packages, provided that the schemaLocation tag is empty on the referenced packages.

You set the Schema File field on the XSD Schema Properties dialog (the element Properties dialog for a Schema element) for the referenced and referencing XSDschema stereotyped packages, so that the relative-path is correctly determined.

 

 

 

 

Schema Package

Generate XSD for Child packages

Select the checkbox to generate schema for child packages of the selected package, and then select either:

Include all packages - to list all child packages under the parent package in the list box, or
Include <XSDschema> packages - to list only those packages that have the stereotype «XSDschema»
 

The list-box shows, for each package, the package name and the file path into which the Schema file can be generated.

To change the file path for a package, double-click on the entry in the list-box, and type in or browse for the new file path in the prompt field.

Select the checkbox against each package for which to generate Schema.

 

 

Generate

Click on this button to generate the Schema for each of the packages selected in the list-box.

 

 

Close

Click on this button to close the dialog, without saving your option selections.

 

 

Help

Click on this button to display this Help topic.

 

 

View Schema

Click on this button to view the generated Schema for a package highlighted in the list-box.

 

 

Progress

Check the progress of Schema generation.

 

 

Learn more

Learning Center topics

(Alt+F1) | Enterprise Architect | SOA and XML Engineering | XSD | Generate XML Schema