Page 1 of 1

Multiple RelaxNG in a single framework

Posted: Thu Mar 21, 2019 11:57 pm
by mwiechec
We would like to have a single framework (CSS, Author Actions, etc.) but we would like also to support multiple RNG schemas. We believe this is possible but do not know how to implement this. We would appreciate any help in this matter.

Thanks

Re: Multiple RelaxNG in a single framework

Posted: Fri Mar 22, 2019 11:18 am
by Radu
Hi,

It would help me to know more about your particular use case.

I see two possible situations here:
1) Some of your XML files need to be validated with a Relax NG Schema and some need to be validated with another.

1.1) If so, do the XML documents have references to the schema using the xml-model processing instruction?
Something like this:

Code: Select all


<?xml-model href="path/to/schema.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<root>
...
</root>
If so, your framework configuration can come with an XML catalog which maps multiple schema references to the proper schema locations inside the framework.
1.2) If the XML documents are not using xml-model to refer to the schema, you could create a base framework configuration specifying the CSSs, actions and so on. That base framework would have no association rules. And then you could use the Preferences->"Document Type Associations" Extend button to extend the base framework twice, for each extension specifying specific association rules and a custom validation scenario which validates the XML with a specific RNG file.

2) All your XML files need to be validated sequentially with two Relax NG Schemas. So an XML would be considered valid only when validated with both RNG schemas.
In your framework you can create a custom validation scenario with two stages, each stage validates the same XML document with a different Relax NG Schema.

Regards,
Radu

Re: Multiple RelaxNG in a single framework

Posted: Fri Mar 22, 2019 10:44 pm
by mwiechec
Radu,

Thank you for the prompt and detailed response. I used solution 1.2 and it worked perfectly. This solution was the most appropriate.

Mark Wiechec