Page 1 of 1

Schematron framework negates CSS from other frameworks

Posted: Tue Apr 06, 2021 4:57 pm
by danlusk
I'm new to frameworks. I wrote a schematron checker and want to incorporate it in a framework extension. There is a framework extension that is added by our DITA CCMS vendor that is being masked by my new framework. As one example, a read-only topic is supposed to show in the editor with a gray background. If my framework extension is checked, there is no gray background. The checker works fine and if I use a URL at the top of the topic instead of a framework, everything works as expected. Can you tell me if there is a setting I should look for? My current settings:

Using Oxygen XML Author 21.1
Framework extends DITA framework
Have tried as both a global and a project option. The project option works sometimes, seemingly randomly.
Author->CSS - have tried all combinations
Validation - added rules location to DITA scenario
Have tried extending different frameworks (Schematron and XSLT) and tried changing the priority. Lowering the priority from Normal to Low makes the CSS work right, but the schematron won't run when you click Validate.

Any suggestions?

Re: Schematron framework negates CSS from other frameworks

Posted: Wed Apr 07, 2021 1:37 pm
by Radu
Hi Dan,

As a short overview, all the frameworks defined in the "Document Type Association" page have association rules.
When Oxygen opens an XML document, it goes through that list of document types from top to bottom, the first document type association which matches the XML document (which has association rules matching the document) is used for validation, content completion, editing. No other framework is used.

Now, a framework can extend another framework, and the elegant way of adding Schematron validation to the DITA framework is by extending it: ... rules.html

which you have probably already done.
But the problem in this case is the CMS already has its framework extension and Oxygen uses either the CMS's framework extension or your framework extension, depending on the priority, on which comes first in the list. But Oxygen will never use both of them.

In general a framework can extend another framework, but it cannot extend a framework extension, because if it could, you could extend your framework from the CMS's framework instead of using the base "DITA" framework.

In the latest Oxygen 23.1 version we added support for a framework configuration script which can be used to extend a framework extension, so in Oxygen 23.1 this could possibly be made to work. But you are probably stuck with 21.1 because the CMS might not officially support Oxygen 23.1.

Here's a possible alternative:
If in the "Document Type Association" page you edit the base "DITA" framework configuration, in the "Validation" tab you will find a default validation scenario named "DITA". If you edit it, it has about 4 different validation stages, the second one of them being a Schematron validation using "${framework}/resources/dita-1.2-for-xslt2-mandatory.sch" which resides in the "OXYGEN_INSTALL_DIR/frameworks/dita/resources/dita-1.2-for-xslt2-mandatory.sch".
But we need to avoid changing that Schematron directly, fortunately Oxygen always locates schemas going through its XML catalog support: ... alogs.html

-Create a folder somewhere containing your custom Schematron file.
-Create in the same folder a new XML catalog file named for example "catalog.xml" with the contents:

Code: Select all

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <uriSuffix uriSuffix="dita-1.2-for-xslt2-mandatory.sch" uri="mySchematron.sch"/>
-In the Oxygen Preferences->"XML Catalogs" page add a reference to this custom "catalog.xml".
- Open a DITA topic and validate it, Oxygen should use the indirection in the custom catalog.xml to use your custom.sch instead of the original dita-1.2-for-xslt2-mandatory.sch.


Re: Schematron framework negates CSS from other frameworks

Posted: Wed Apr 07, 2021 2:56 pm
by danlusk
Hi Radu,

That worked perfectly with no conflicts that I can see. Thanks!

I'll put it out to my testers and let you know if anything comes up.