Open raffazizzi opened 8 years ago
Great idea! Two thoughts:
Face to Face breakout group (Providence 2016-04) all decide this is a good idea but very low priority.
Instead of a constant / variable there should be a function that returns the members of a given class, e.g.:
teifn:getMembersFor("att.specialrend")
To be implemented in the XSLTs eventually.
@raffazizzi proposes two possible ideas at this point: the idea that we should have constants in ODD, and the idea that we should have functions in a teifn namespace which (presumably) ODD-writers could call in their ODDs. I think the intention is that both of these would be used in the context of embedded Schematron. @peterstadler proposes the more generic att.something.members, which seems more widely-useful and more characteristic of current ODD practices, but it would have issues with circularity, presumably.
In all cases, we would need to give some careful thought to how this should be implemented. For example, if element <x>
claims membership of att.effable
, but then deletes the @eff
attribute and modifies the @off
attribute, should it still be retrieved as one of the $MEMBERS
? How about if the Schematron rule that summons $MEMBERS appears on ODD2 in the chain, while the attributes are deleted/modified in ODD4, further on? What if the ODD4 elementSpec replaces (@mode='replace'
) the @eff
and @off
attributes with completely different definitions?
It would be useful to have some constants that available for use in XPaths within a
classSpec
. For example "MEMBERS" to get the names of all members of a<classSpec type="atts">
.Example
Create an attribute class that sets schematron rules for the value of
@rend
. This is were being able to refer the members of the class would be useful! Let's imagine it's called$MEMBERS
.This makes sure that the schematron rule only applies to the members of the class. So if I replaced
@rend
on a non-member element, the schematron would not apply.Implementing something like this requires a decision on whether ODD should define constants, which ones, and where they would be documents (possibly in the definition of
classSpec
). The heavy-lifting however, would happen in the XSLT that processes the ODD.Below is a full ODD for a working example. The hypothetical constant "MEMBERS" is expanded to
('p','ab')
.