Oxygen XML Author Eclipse plugin uses the rules defined in the detected schema to report errors and
warnings during automatic and manual validations that help maintain the structural integrity
of your XML documents. You can specify the schema to be used for validation directly in validation scenarios
and there are several methods that can be used to do so.
Use the Validate with Action to Specify a Schema for Validating
the Current Document
To validate the current document using a specified schema, follow these steps:
-
Select the Validation with action from the
Validation
drop-down menu on the toolbar (or XML menu).
Step Result: The Validate with dialog box is
displayed:
Figure 2. Validate with Dialog Box
This dialog box contains the following options:
-
URL - Allows you to specify or select a URL for the schema. It also
keeps a history of the last used schemas. The URL must point to the schema file that can be
loaded from the local disk or from a remote server through HTTP(S) or SFTPS. You can specify the URL by using the text
field, the history drop-down, the
Insert Editor
Variables button, or the browsing actions in the
Browse drop-down list.
-
Schema type - Select a possible schema type from this combo box that
is populated based on the extension of the schema file that was entered in the
URL field. The possible schema types are: XML Schema, DTD, Relax
NG, Relax NG Compact, Schematron, or NVDL.
- Embedded Schematron rules - If you have selected XML Schema or
Relax NG schemas with embedded Schematron rules and you want to use those embedded rules,
select this option.
-
Public ID - Allows you to specify a public ID if you have selected a
DTD.
- Extensions- Opens a dialog box that allows you to specify Java extension JARs to be used during the
validation.
- Schematron phase - If you select a Schematron schema, this
drop-down list allows you to select a Schematron phase that you want to use for validation.
The listed phases are defined in the Schematron document.
- Select the schema to be associated with the manual validation and configure the rest
of the options according to your preferences.
- Click OK.
Result: The current document is validated using the schema you specified.
Tip: To quickly open the schema used for validating the
current document, select the
Open Associated Schema action from the toolbar (or
XML menu).
Use the Validate with Schema Action to Specify a Schema for
Validating all Selected Documents
To validate multiple documents using a specified schema, follow these steps:
- Select all the documents you want to validate in the
Project
Explorer view.
-
Invoke the contextual menu (right-click) and select the Validate with
Schema action from the Validate submenu.
Step Result: The Validate with dialog box is
displayed:
Figure 3. Validate with Dialog Box
This dialog box contains the following options:
-
URL - Allows you to specify or select a URL for the schema. It also
keeps a history of the last used schemas. The URL must point to the schema file that can be
loaded from the local disk or from a remote server through HTTP(S) or SFTPS. You can specify the URL by using the text
field, the history drop-down, the
Insert Editor
Variables button, or the browsing actions in the
Browse drop-down list.
-
Schema type - Select a possible schema type from this combo box that
is populated based on the extension of the schema file that was entered in the
URL field. The possible schema types are: XML Schema, DTD, Relax
NG, Relax NG Compact, Schematron, or NVDL.
- Embedded Schematron rules - If you have selected XML Schema or
Relax NG schemas with embedded Schematron rules and you want to use those embedded rules,
select this option.
-
Public ID - Allows you to specify a public ID if you have selected a
DTD.
- Extensions- Opens a dialog box that allows you to specify Java extension JARs to be used during the
validation.
- Schematron phase - If you select a Schematron schema, this
drop-down list allows you to select a Schematron phase that you want to use for validation.
The listed phases are defined in the Schematron document.
- Select the schema that you want to use to validate all selected documents and
configure the rest of the options according to your preferences.
- Click OK.
Result: The selected documents are validated using the schema you specified.