dita-xsd2sch
I'm planning to create a DITA specific process to generate a single schematron file from a set of DITA xsd files within the next few weeks. The input would probably be a catalog file that references alle relevant schema files and that usually exists anyway when creating a DITA based framework. To improve the performance the implementation of #37 would probably be a necessity.
Another DITA specific addition would be allow sch:assert/:report statements directly within the xs:appinfo element. The sch:pattern and sch:rule elements would be added automatically and the pattern attribute @context would be generated based on the class attribute for the given element or type to something like *[contains(@class, ' my-domain/my-element ')]. (This follows the idea from #17.)
Now my actual question is if such a DITA specific extraction might be a valid part of the schematron project. Otherwise I would just put it into my own dita-semia github project. Of course, any other thoughts on these ideas are welcome as well.
I'm not sure that I understand "a DITA specific process to generate a single schematron file from a set of DITA xsd files", but:
- Does
xsd2sch(currently at https://github.com/Schematron/schematron/tree/master/trunk/xsd2sch but #32 wants it as a separate repository) do something like what you want? - Putting Schematron
assertandreportinside a RELAX NG schema is probably more common and better developed. Would it be an option for you to look at using the official DITA RELAX NG schema as a starting point? - If you make your own GitHub project, you would have the option making a pull request on Schematron/awsome-schematron to get it added to the list, though I/we don't yet know how awesome something should be for it to be added.
- I/we also don't have fixed criteria for adding a new repository to the Schematron organization. Every code project that's been added so far has been transferred from an existing repository. I guess that once you get the repository up and the code working, we, collectively, could see whether it would work as a repository under the Schematron organization.
Thanks for the answer.
- to 1. I consider my dita_xsd2sch as an extension of xsd2sch. And I will probably implement it based on a clone of xsd2sch with an additional option to be activated on command line.
- to 2. I'm using several specialized XSDs since the support for attribute defaults of RELAX NG is insufficient for my use-cases (i.e. attribute defaults are only based on element names, not types). Still the concept would surely work for RELAX NG as well - not without modifying the implementation, though.
- to 3./4. Sounds to me like a good plan.
Closing until you get to 3./4.
What is the status of this?
I completed the implementation several months ago and use it for my own projects. But I didn't bother to put it on github since I saw no indication for anybody else being interested in it. So feel free to close this issue.
I recently uploaded my code here: https://github.com/dita-semia/dita-xsd2sch