Page 1 of 1

Embedded schematron: problem with pattern/@name and value-of

Posted: Fri Feb 28, 2014 9:48 am
by Patrik

i just changed to oxygen 15.2 and got now errors within my xsd-embedded schemtron rules: Wht did I do wrong? I think this should'n be errors and in 15.0 and 15.1 it works well.

example causing both erors:

Code: Select all

<xs:element name="draft-comment" substitutionGroup="StandardInlineElement">
<sch:rule context="draft-comment">
<sch:report test="true()" role="warn">
draft-comment: '<sch:value-of select="string-join(.//text()[not(matches(., '^\s+$'))], '')"/>'
<xs:extension base="anyType">
<!--<xs:attribute name="author"/>-->
<!--<xs:attribute name="time"/>-->
<xs:attribute name="class" fixed="- topic/draft-comment"/>
<xs:attributeGroup ref="attlistSpacePreserve"/>
Thanks and regards,


Re: Embedded schematron: problem with pattern/@name and valu

Posted: Fri Feb 28, 2014 12:33 pm
by radu_pisoi

In oXygen 15.2 version we improved the validation of an XML document with a Schematron schema by also validating the Schematron schema. So the first step in the validation process is to validate the Schematron schema itself. If the schema is valid, then the XML document will be validated against the schema, otherwise you will see only the Schematron validation problems.

This is also true when the Schematron rules are embedded in XML Schema or RelaxNG schemas.

In your case, you are developing an ISO Schematron pattern but you are using the namespace for Schematron 1.5 for it. In the Schematron 1.5 specification the 'name' attribute is requested for 'pattern' element. Also the 'value-of' element is not available.

To switch between Schematron 1.5 and ISO Schematron you have to change the namespace of the Schematron elements as follows:
* use '' for ISO Schematron;
* use '' for Schematron 1.5.

In oXygen 15.2, you can validate the embedded Schematron rules from the XML Schema by using the 'Validate XML Schema with embedded Schematron' validation scenario. To use it, you should associate the scenario with your opened XML Schema document by using the 'Configure the Validation Scenario(s)' action available from the toolbar. After you associate the scenario, you have to re-validate the XML Schema document to see also the problems related to the Schematron code.


Re: Embedded schematron: problem with pattern/@name and valu

Posted: Fri Feb 28, 2014 1:40 pm
by Patrik
Hi Radu,

this solved my problem. Thanks again.