an inheritance mechanism for document types
Posted: Wed Mar 25, 2015 1:40 pm
Hi,
Document association rules are now exclusive, meaning that when two document types are associated with the same criteria, only the one with highest priority is applied.
Yet, in some cases it would be nice to have some inheritance mechanism, where default rules from document type 1 are applied, and extended with specific rules of document type 2. For instance, when developing an extension to a TEI document type in a separate Oxygen project .xpr file, it could be handy to inherit all default TEI document type properties (document type association rules, validation and transformation scenarios), while at the same time associating more specific properties.
I'll try to illustrate an inheritance scenario with a hypothetical TEIextension.xpr file that just specifies an extra rule matching all standard TEI documents that have a /TEI/@rend[.='TEIextension'] attribute. Due to the fact that such a document matches the default TEI association rules, all properties of the default TEI document type are associated with this document. Additionally, the TEIextension.xpr file adds some dedicated Schematron validation rules, and a couple of XSLT transformations to other output formats.
If I want to achieve this currently, I have to copy all properties from the TEI document type into the specific TEIextension document type. This means that the default TEI properties have to be kept in sync with possible changes to the default TEI document type (when the TEI framework is updated, for example).
Of course, such inheritance is not always desirable. Would a configurable 'inheritance' setting be worth considering for a future Oxygen version?
Best,
Ron
Document association rules are now exclusive, meaning that when two document types are associated with the same criteria, only the one with highest priority is applied.
Yet, in some cases it would be nice to have some inheritance mechanism, where default rules from document type 1 are applied, and extended with specific rules of document type 2. For instance, when developing an extension to a TEI document type in a separate Oxygen project .xpr file, it could be handy to inherit all default TEI document type properties (document type association rules, validation and transformation scenarios), while at the same time associating more specific properties.
I'll try to illustrate an inheritance scenario with a hypothetical TEIextension.xpr file that just specifies an extra rule matching all standard TEI documents that have a /TEI/@rend[.='TEIextension'] attribute. Due to the fact that such a document matches the default TEI association rules, all properties of the default TEI document type are associated with this document. Additionally, the TEIextension.xpr file adds some dedicated Schematron validation rules, and a couple of XSLT transformations to other output formats.
If I want to achieve this currently, I have to copy all properties from the TEI document type into the specific TEIextension document type. This means that the default TEI properties have to be kept in sync with possible changes to the default TEI document type (when the TEI framework is updated, for example).
Of course, such inheritance is not always desirable. Would a configurable 'inheritance' setting be worth considering for a future Oxygen version?
Best,
Ron