schematron icon indicating copy to clipboard operation
schematron copied to clipboard

dita-xsd2sch

Open PStellmann opened this issue 8 years ago • 6 comments

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.

PStellmann avatar Feb 11 '17 21:02 PStellmann

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:

  1. 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?
  2. Putting Schematron assert and report inside 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?
  3. 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.
  4. 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.

tgraham-antenna avatar Feb 20 '17 13:02 tgraham-antenna

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.

PStellmann avatar Feb 22 '17 06:02 PStellmann

Closing until you get to 3./4.

tgraham-antenna avatar Feb 23 '17 23:02 tgraham-antenna

What is the status of this?

tgraham-antenna avatar Jan 10 '18 12:01 tgraham-antenna

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.

PStellmann avatar Jan 12 '18 07:01 PStellmann

I recently uploaded my code here: https://github.com/dita-semia/dita-xsd2sch

PStellmann avatar Feb 10 '18 10:02 PStellmann