Re: ODD constrained attribute class membership

Lou Burnard <[email protected]>
Newsgroups gmane.text.tei.general
Message-ID <[email protected]>
Interesting question... Let's see if I've understood it correctly.

Let's say your ODD defines an attribute class "att.xyz" supplying 
attributes x, y, and z. And you want to make element E a member of that 
class (so that it gets attributes y and z), but you don't want it to 
have attribute x. There are only two ways of doing this currently:
1) the easy one : just add an attlist  containing an <attDef ident="x" 
mode="delete"/> to the elementSpec for E
2) the tidy one: if E is not the only element which has this behaviour, 
it would be more elegant to define a SECOND class att.yz which provides 
just those two attributes. Your elements can then state which of the two 
classes they belong to.

It would be nice if this second class could inherit y and z from att.xyz 
instead of having to define them itself, but the current state of ODD 
processing doesn't support things being defined and modified within the 
same derived module, i.e. in the same ODD. If it did you could also 
solve this more simply using classRef (see 
https://github.com/TEIC/Stylesheets/issues/227)

So much for the theory. Maybe you could explain your use case a bit 
though. It may well be that the TEI already provides a simpler method of 
doing what you want to do without having to invent new non TEI 
atttributes! The class att.linking is a TEI class, of course, so while 
you can suppress attributes it provides and add new attributes to it, it 
might be better practice to define your own att.myLinking class for this 
purpose. It can of course inherit whatever it wants from the real 
att.linking.


On 20/01/17 09:06, Benjamin W. Bohl wrote:
> Der TEI community,
>
> I’m currently working on a schema definition using ODD and have some attributes defined in a class. Now I want to define an element that allows only certain attributes of that class.
> I tried using @exclude in the memberOf definition but that didn’t work. So I came up with the idea to use attest/attRef and reference the specific attribute I want to allow. That would work if there was another element being a member of the specified class but all elements use only certain attributes of that class…
>
> The attribute class is att.linking and should group all attributes that hold references to uri:s, other elements and the like. At the moment it holds only two attributes ‘uri’ and ‘name.ref’ (referencing another elements @name – comparable to referencing xml:id but not not constrained to the uniqueness of xml:id across a xml file). More attributes might come up that would fit in this class.
>
> Is there a technical solution to this or is it rather a modelling problem?
> In any case, maybe you could help me with some ideas of how to tackle this problem!
>
> Many thanks,
> Benjamin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.