# Generate Schema from Instance Document Dialog

> **TL;DR**
> `Tools | XML Actions | Generate XSD Schema from XML File`

In this dialog, specify the options for generating an XSD (XML Schema Definition) [Schema](https://www.w3schools.com/xml/schema_intro.asp) that describes the structure of the desired XML file.

> **Note:**
> * This functionality is available if you have installed and enabled the [Jakarta EE: Web Services (JAX-WS)](https://plugins.jetbrains.com/plugin/18584-jakarta-ee-web-services-jax-ws-) plugin.
>
> * The menu item and the dialog are available when an XML document is opened in the active editor tab.

| Item | Description |
| --- | --- |
| Instance document path | In this field, specify the full path to the XML document to be used as the basis for Schema generation.     By default, the field shows the full path to the current file. To use another XML document, click Browse ![the Browse button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.inline.browse.svg) and select the desired file in the [dialog that                         opens](null).                  |
| Result schema file name | In this field, specify the name of the output file for the Schema to be generated. By default, the generated XSD Schema file will inherit the name of the instance document used and will have the XSD extension. If you type another name for the Schema to be generated, make sure the extension is correct.     The default location for the generated Schema is the directory where the source XML instance document resides. To specify another location, click Browse ![the Browse button](https://resources.jetbrains.com.cn/help/img/idea/2026.2/app-client.expui.inline.browse.svg) and select the desired path in the [dialog that                         opens](null).     |
| Design type | Specify how to declare elements and complex types. The available options are:       * Local elements / global complex types: defines child elements locally within their parent elements, while extracting complex structures into reusable named complex types (Venetian Blind design).    * Global elements / local types: declares all elements globally but keeps the structure of each element as an anonymous local type (Salami Slice design).    * Local elements / types: defines both elements and their types locally, nesting everything inside the parent element (Russian Doll design).     Learn more from [Introducing Design Patterns in XML Schemas](https://www.oracle.com/technical-resources/articles/java/design-patterns.html) (https://www.oracle.com/).    |
| Detect simple content type | From this list, choose the type to render leaf text, which should be distinguished from the text used. The available options are:       * string: uses `xs:string` for all leaf text values.    * smart: infers an appropriate built-in XML Schema type for each leaf text value, using `xs:string` when no more specific type can be inferred.    |
| Detect enumerations limit | In this field, type the number of occurrences to cause the Schema enumeration appearance. To suppress Schema enumeration, specify 0.  |

## See also

### Concepts

[Web services](web-services.html)  [Web service clients](web-service-clients.html)

### Procedures

[Generating XML schemas from instance documents](generating-xml-schema-from-instance-document.html)  [Validating web content files](validating-web-content-files.html)

### Reference

[Generate Java from XML Schema using JAXB Dialog](generate-java-from-xml-schema-using-jaxb-dialog.html)  [Generate Java Code from XML Schema using XmlBeans Dialog](generate-java-code-from-xml-schema-using-xmlbeans-dialog.html)

