An XSD (XML Schema Definition) Schema is required
for running structure validation checks on a Web content file.
PyCharm can scan any XML file for the existing elements and attributes and generate a Schema for it.
- With the desired XML document opened in the active editor tab, choose on the main menu.
- In the Generate Schema From Instance Document dialog box that opens
configure the Schema generation procedure:
- In the Instance Document Path text box,
specify the location of the file to be used as the basis for Schema generation.
By default, the field shows the full path to the current file.
Accept this suggestion or click the Browse button
and select the desired file in the dialog that opens.
- In the Result Schema File Name text box, specify the name of the output file
to place the generated Schema in.
PyCharm suggests the name of the source XML document with the
.xsd
extension. If you type another name, make sure the extension is correct. -
Specify the location of the generated Schema. By default, the generated Schema file
will be placed in the same directory as the source XML instance document.
To specify another location, click the Browse button
and select the desired path in the dialog that opens.
- From the Design Type drop-down list, select the way to declare elements and complex types.
- From the Detect Simple Content Type drop-down list, select the type to use for leaf text.
- In the Detect Enumerations Limit text box,
type the number of occurrences to cause the Schema enumeration appearance.
To suppress Schema enumeration, specify 0.
- In the Instance Document Path text box,
specify the location of the file to be used as the basis for Schema generation.
By default, the field shows the full path to the current file.
Accept this suggestion or click the Browse button
See Also
Concepts:
Procedures:
- Markup Languages and Style Sheets
- Validating Web Content Files
- Generating Instance Document from XML Schema
Reference:
Web Resources: