Page 1 of 1

Embedded Schematron rules in RNC files

Posted: Sat Dec 12, 2009 9:12 pm
by solarian
oXygen seems to be having trouble with embedded Schematron rules in .rnc files, but works fine with corresponding .rng files. The error it produces is:

Code: Select all

E [Schematron 1.5] org.xml.sax.SAXParseException: Content is not allowed in prolog.
As an example, try validating with embedded rules using the following:
<?oxygen SCHSchema="http://www.tei-c.org/release/xml/tei/cu ... ei_all.rng"?>
then:
<?oxygen SCHSchema="http://www.tei-c.org/release/xml/tei/cu ... ei_all.rnc"?>
(waiting a few seconds for it to get & parse the remote file of course)

At the same time Jing is happy to validate the .rnc file. The above error message doesn't help me to identify the problem, as it seems to be thinking there's a BOM in the way, which there isn't.

Re: Embedded Schematron rules in RNC files

Posted: Sat Dec 12, 2009 9:23 pm
by solarian
P.S. There is a second issue which is worth addressing separately. Using the above example file for reference, if (instead of using <?oxygen SCHSchema="..." ?>) we click on "External Validation..." and validate it as a RelaxNG Schema in compact syntax mode (remembering to select "Embedded schematron rules") then the error with the schematron validation is not reported, it simply fails silently. This would lead one to believe a given XML file validates when perhaps it doesn't.

Re: Embedded Schematron rules in RNC files

Posted: Sun Dec 13, 2009 11:32 am
by george
Hi,

Embedded Schematron in Relax NG compact is not supported by oXygen.

Best Regards,
George

Re: Embedded Schematron rules in RNC files

Posted: Sun Dec 13, 2009 11:35 am
by george
To complete my answer.
You can convert the RNC schema to RNG automatically so the workaround is to always use Relax NG in XML syntax when you want to use embedded Schematron.
The embedded Schematron rules are annotations for Relax NG so they have no impact in the Relax NG validation.

Best Regards,
George

Re: Embedded Schematron rules in RNC files

Posted: Sun Dec 13, 2009 5:27 pm
by solarian
Thanks for pointing out that Schematron is not supported when embedded in Relax NG compact (and it is perfectly easy to convert to XML syntax, so this is no problem for me at all). However, I think it would be a good idea to make this clear within oXygen and in the User Manual. At the moment, both the manual and the program itself imply that embedded Schematron is supported.

Best wishes,

Ian

Re: Embedded Schematron rules in RNC files

Posted: Mon Dec 14, 2009 6:44 pm
by george
Dear Ian,

We will update the user interface and we will try to make that clear also from the user manual.

Thank you,
George