Re: ODD constrained attribute class membership

Lou Burnard <[email protected]>
Newsgroups gmane.text.tei.general
Message-ID <[email protected]>
Immediately after  pressing "send" on my previous reply, I thought of  a 
much more elegant solution, in which att.xyz inherits y and z from 
att.yz and completes them with x. Like this


             <classSpec type="atts" ident="att.xy">
                <desc>provides two attributes</desc>
               <attList>
                <attDef ident="y">
                   <desc>the y attribute</desc>
                   <datatype>
                      <dataRef name="NCName"/>
                   </datatype>
                </attDef>
                <attDef ident="z">
                   <desc>the z attribute</desc>
                   <datatype>
                      <dataRef name="NCName"/>
                   </datatype>
                </attDef>
                </attList>
             </classSpec>

             <classSpec type="atts" ident="att.xyz">
                <desc>provides three attributes</desc>
                <classes>
                   <memberOf key="att.xy"/>
                </classes>
                <attList>
                   <attDef ident="x">
                      <desc>the x attribute</desc>
                      <datatype>
                         <dataRef name="NCName"/>
                      </datatype>
                   </attDef>
                </attList>
             </classSpec>

That seems to work. An element which says it is a member of att.xy will 
get attributes x and y, while one that says it's a member of att.xyz 
will get x, y, and z.




  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.