Schematron invalidation message on included patterns

Having trouble installing Oxygen? Got a bug to report? Post it all here.
whyme
Posts: 93
Joined: Fri Mar 08, 2013 8:58 am

Schematron invalidation message on included patterns

Post by whyme »

I have a simple master schematron file (root <sch:schema>) + included schematron file (root <sch:pattern>). The first validates fine but the second, even when empty and otherwise valid, returns this error message:

Code: Select all

Scenario name: Schematron
Document type: Schematron
Engine name: ISO Schematron
Severity: error
Description: When 'standalone' or 'doctype-system' is specified, the document must be well-formed; but this document contains more than one top-level element
A web search suggests a serialization issue, but I don't see any options for changing that serialization, nor is there documentation in Schematron to indicate anything with options referring to standalone or doctype-system. Any suggestions on how to deal with this?
florin
Posts: 56
Joined: Wed Jan 05, 2011 10:36 am

Re: Schematron invalidation message on included patterns

Post by florin »

Hello,

A Schematron schema contains the <schema> element as root element. A Schematron file that contains any other element as root is not a valid Schematron schema by its own. Such files can be used only in inclusions within a valid Schematron schema (like in your master file).

That's why the included Schematron file does not validate by its own. To validate it, you should define a validation scenario for the module, using the "Configure Validation Scenario(s)" dialog box, and add the master file to validate the module in its context. Just press the New button and input the following values:
- URL of the file to validate: input the URL of the master file (that includes the module). You can also use editor variables for this.
- File type: Schematron Document
Now, the new validation scenario should be associated with the module and it should be validated in the context of the master file.

Another way to achieve same results, and even more, is to use the Master Files support. To enable it, right-click on the project's root node and activate "Enable Master Files Support". After, add the master file to the Master Files directory. Now, the module should be validated in the context of the master file, without needing to create a validation scenario. Unfortunately, I've just tested this and it seems there is an issue in oXygen that makes things not work as expected - you'll have to open the Preferences dialog box (Options > Preferences), go to the Document Type Association options page and Edit the Schematron document type. In the newly opened dialog box, select the Validation tab and deactivate the Schematron default validation scenario. This way, oXygen will use the Master Files support (although it should had a higher priority than the default validation scenario).
Beside validation, the Master Files support also help you when editing the modules, by providing information from the master files, like ids of the phases and rules from the master file. Also, it helps you with search and refactoring operations.
You can find out more about the Master Files support for Schematron here:
http://www.oxygenxml.com/doc/ug-editor/ ... ntent.html

Best regards,
Florin
Florin Avram
<oXygen/> XML Editor
Post Reply