Schematron editor unduly gives error "Invalid format for 'cl

Post here questions and problems related to editing and publishing DITA content.
akuh
Posts: 10
Joined: Wed May 15, 2013 12:23 am

Schematron editor unduly gives error "Invalid format for 'cl

Post by akuh »

Hello,

the schematron editor gives an error when my schematron file is in a directory of my DITA project, but does not give the error when my schematron file is in INSTALL_DIR\\frameworks\dita\styleguide\rules.

Here is the text of the error:
'E [DITA_SPECS] Invalid format for 'class' attribute. Class attribute not specified.'

The schematron text is very simple (I have written it just for posting this new topic):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<pattern id="check.shortdesc">
<rule context="shortdesc" role="warning">
<report test="string-length(.)>20">text length > 20</report>
</rule>
</pattern>
</schema>
How can I get rid of the error message? I want that because the error makes the text of the schematron difficult to read and because it is seemingly incorrect.

I could copy the schematron to INSTALL_DIR\\frameworks\dita\styleguide\rules, but I then cannot save the changes made to it and have then to save via an intermediary file that I afterwards copy to INSTALL_DIR\\frameworks\dita\styleguide\rules.

Regards.
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Schematron editor unduly gives error "Invalid format for

Post by Radu »

Hi,

The error message you obtained has the engine name [DITA_SPECS] which means that it was given by our special DITA validation engine which is not related to Schematron in any way.

I need to understand more about your setup.
If you double click the error does it open a DITA topic or the Schematron file?
Are you validating a DITA topic using that Schematron? How exactly are you associating the Schematron schema to the DITA topic?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
akuh
Posts: 10
Joined: Wed May 15, 2013 12:23 am

Re: Schematron editor unduly gives error "Invalid format for

Post by akuh »

Hello,

I am working on a DITA project.

I receive the error message while editing the schematron file.

That is, the error message appears at the bottom of the editing window of the schematron file.

And,
- in text mode, almost all the text of the schematron file is underlined with a red undulating line,
- in Author mode, a part is underlined with red undulating lines and another part is underlined with a red bold straight line.

Note: It is to be noted that the schematron file works fine when it is used for validating DITA files.

If I double click the error message, which appears at the bottom of the window, I get a dialog box whose name is 'Message'.

The dialog box gives the following items of information:
- Description
- Severity
- System ID (= name of schematron file)
- Scenario name
- Main validation file (= name of scjhematron file)
- Engine name: DITA validation
- Type: DITA specifiction
- Start location
- End location
- Additional details

Using button 'Configure validation scenario' (which is above the editing window) I had associated a validation scenario that uses, among other things, oxygen schematron files 'dita-1.2-for-xslt2-mandatory.sch' and 'dita-1.2-for-xslt2-other.sch'.

Out of curiosity (and in consequence of having read your reply), I have removed the association to see the effect. As a result, the error message has disappeared and all the underlining red lines have disappeared.

So removing the association seems to be the solution.

I however would like automatic schematron validation on my DITA files, which means I will re-associate a validation scenario. Is there a way to prevent the scenario to be run automatically on schematron files?

I hope I have given you enough information about my problem.

Regards.
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Schematron editor unduly gives error "Invalid format for

Post by Radu »

Hi,

Whenever a Schematron document is opened and validated it is validated with the corresponding Schematron vocabulary grammar. So you should not associate to the opened Schematron document a validation scenario which was specifically created to validate DITA topics with Schematron. Just let it validate using its default validation engine.

Now for validation of opened DITA topics:

If you open a DITA topic you can use the Configure Validation Scenario(s) toolbar button and you will see the precise validation scenario which is used for it.
In Oxygen DITA topics will be validated by default with that DITA validation scenario which you tried to also associate to the opened Schematron file without the need for you to do anything.

If you want to validate DITA topics by using your custom Schematron rules you can either:

1) Open the DITA topic, use Configure Validation Scenario(s) toolbar button, duplicate the default DITA scenario and add another Schematron validation stage to it which uses your custom Schematron. Then for each other opened DITA Topic associate your new validation scenario using the Configure Validation Scenario(s) toolbar button.

2) In the Document Type Association Preferences page either edit the "DITA" document type or if you do not have the access rights for this extend the document type.
Then in the Validation tab you ca edit the DITA validation scenario directly and modify it.

http://www.oxygenxml.com/doc/ug-oxygen/ ... arios.html

One more thing:
When you open a DITA Map in the DITA Maps Manager view, the toolbar has a Validate and check for completeness action. You can also add your additional Schematron file to use it for validating the entire set of topics in the DITA Map using that specific action.

http://www.oxygenxml.com/doc/ug-oxygen/ ... idate.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
akuh
Posts: 10
Joined: Wed May 15, 2013 12:23 am

Re: Schematron editor unduly gives error "Invalid format for

Post by akuh »

Hello,

thank you for your detailed answer.

Things are clear now.

One point however. I do not remember having explicitly associated a validation scenario with the schematron file (whether via the toolbar button or not).

I have noted I had the same problem with my custom CSS files and also regarding it I do not remember having explicitly associated a validation scenario with it (whether via the toolbar button or not).

To edit the schematron file or the CSS file, I just double click it from Windows Explorer and then modify it via the Oxygen editor.

I wonder if the association was not done automatically.

Thank you for your help.

Regards.
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Schematron editor unduly gives error "Invalid format for

Post by Radu »

Hi,

There is definitely something wrong on your side.
Could you tell me the precise Oxygen version you are using? And operating system?
Did you make any changes to the DITA document type association in the Preferences->Document Type Association page? For example did you modify the association rules?
Do you have any custom plugin installed?

You mentioned the same thing happens for opened CSS files. Could you send us a screenshot of the application (support@oxygenxml.com) with a CSS opened in Oxygen and the validation error reported in the list?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
akuh
Posts: 10
Joined: Wed May 15, 2013 12:23 am

Re: Schematron editor unduly gives error "Invalid format for

Post by akuh »

Hello,

maybe I should have made clear in my previous post that everything is fixed now and running OK.

For all my files, I have removed all the associations made via the 'Configure Validation Scenario(s)' toolbar button.

I have afterwards done one of the things you proposed in one of your replies (here below the text of that thing, rendered as a quote), which I had never done before:
In the Document Type Association Preferences page either edit the "DITA" document type or if you do not have the access rights for this extend the document type.
Then in the Validation tab you ca edit the DITA validation scenario directly and modify it.
As a result, everything is now running correctly.

Before creating this issue in the DITA forum, I never made any changes to the DITA document type association in the Preferences->Document Type Association page and did not modify the association rules. I have made these changes in consequence of your posts suggestions. And these changes have successfully worked.

FYI, I use XML Editor 16.1, build 2015012213 and Windows 7 professional Service Pack 1.

As a reminder, I had the problem only with CSS files and Schematron files located in a directory of my DITA project. I had no such problems (at least for the schematron files, I did not try to check for the CSS files) when they were in a sub-directory of the DITA framework ((i.e., 'resources' sub-directory or 'styleguide\rules' sub-directory).

In my previous post, I simply wondered if the problem did not occur because I double-clicked from Windows Explorer on the CSS/schematron files to edit them while the file currently edited by Oxygen was a DITA file that has an association set up via the 'Configure validation scenario' toolbar button.

As the issue is fixed now, I would suggest we close this post.

Again thank you for your detailed and useful answers.

Regards.
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Schematron editor unduly gives error "Invalid format for

Post by Radu »

Great,

I think one possibility which would explained the misbehavior would have been if at some point you referenced your DITA project in Oxygen's Project view and then right clicked on it and chose Validate->Configure validation scenarios and chose the DITA validation scenario. After this, Oxygen would use the DITA validation scenario to validate all resources from that folder, including Schematrons, CSSs and anything else.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
akuh
Posts: 10
Joined: Wed May 15, 2013 12:23 am

Re: Schematron editor unduly gives error "Invalid format for

Post by akuh »

This last one rings a bell.

My feeling is that it should be that.

Thanks and regards.
Post Reply