Edit online

Associating a Schema Through a Validation Scenario

Oxygen XML 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.

Configure a Validation Scenario and Specify the Schema

To associate a schema to a validation scenario to be used whenever the scenario is invoked, follow these steps:
  1. Select the Configure Validation Scenario(s) from the Validation toolbar drop-down menutoolbar, or from the Document > ValidateXML menu (or the Validate submenu when invoking the contextual menu on a file in the Project viewProject Explorer view).
  2. Click the New button to create a new validation scenario or the Edit button to modify an existing one.
  3. Add or configure validation units according to your needs and click the Specify Schema button.

    Step Result: The Specify Schema dialog box is displayed:

    Figure 1. Specify Schema Dialog Box

    The Specify Schema dialog box contains the following options:

    Use detected schema
    Uses the schema detected for the particular document.
    Use custom schema
    Allows you to specify the schema using the following options:
  4. Select the schema to be associated with the validation unit and configure the rest of the options according to your preferences.
  5. Click OK on both dialog boxes.

Result: The schema is now associated with that validation scenario whenever it is invoked.

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:
  1. Select the Validation with action from the Validation drop-down menu on the toolbar (or Document > ValidateXML menu).

    Step Result: The Validate with dialog box is displayed:

    Figure 2. Validate with Dialog Box
    This dialog box contains the following options:
  2. Select the schema to be associated with the manual validation and configure the rest of the options according to your preferences.
  3. Click OK.

Result: The current document is validated using the schema you specified.

Tip:

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:
  1. Select all the documents you want to validate in the Project view Project Explorer view.
  2. 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:
  3. Select the schema that you want to use to validate all selected documents and configure the rest of the options according to your preferences.
  4. Click OK.

Result: The selected documents are validated using the schema you specified.