Multiple RelaxNG in a single framework

Post here questions and problems related to oXygen frameworks/document types.
mwiechec
Posts: 17
Joined: Mon Nov 19, 2018 10:49 pm

Multiple RelaxNG in a single framework

Post 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
Radu
Posts: 9470
Joined: Fri Jul 09, 2004 5:18 pm

Re: Multiple RelaxNG in a single framework

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
mwiechec
Posts: 17
Joined: Mon Nov 19, 2018 10:49 pm

Re: Multiple RelaxNG in a single framework

Post 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
Post Reply