Advanced ODD Topics

Syd Bauman and Julia Flanders

2010-08-18

Changing class membership

What if we want to change where an element can go in the document structure? (Or change what kinds of elements a given element can contain—which is the same thing seen from another angle.)

The easiest way to do this is to change what model classes the element belongs to. Let’s remind ourselves that model classes are the functional groupings of elements, based on their structural properties: so for instance there’s a model class model.biblPart of things that are parts of bibliographic citations (authors, titles, publication dates, etc.): these things may all go inside bibl

To explain model classes, it may help to think about them with an analogy to country club membership...

Imagine a country club that has a large number of different amenities: golf course, swimming pool, meeting rooms, business center, sleeping quarters, basketball court, safari area; and also some practical spaces like administrative offices, kitchen, janitorial closets, housekeeping, staff lounge, stuff like that

Each of these spaces has certain kinds of events that different groups of people might attend, and we can also imagine that as a member, you might join just for the tennis, or just for the golf, or you might get the Golden Total Access Membership that lets you use the entire facility. So your membership card might be one of those magnetized swipe access cards that can be coded to let you into spaces selectively based on your level of access and type of membership. So the golf-only people can get into the golf course, and the tennis-only people can get into the tennis courts, but all members have access to the meeting rooms and the basketball court and so forth.

And similarly, the janitorial staff have cards that get them access to those spaces, and also to the janitorial closets; and security has super-duper cards that give them access to absolutely everything, all the time.

Model classes are like country club membership classes and support staff jobs: if you’re a member of a specific model class (or a club membership class) you’re able to appear in certain spaces that are appropriate to your identity. If you’re a heading, you can go in the kinds of places where headings are allowed to go. Some model classes are very, very specific (like a club membership that only lets you play basketball but nothing else) while others are very, very broad (like the security staff who can go everywhere).

So if we want to change where an element may go, we can do it by changing what model class it is part of: basically, changing our country club guest’s membership type so that his key gets him into different spaces.

Example

So now let’s look more specifically at what the customization actually looks like. There are two different kinds of change under consideration here:

So if we want to restrict where an element may go, we can do it by removing it from certain model classes, basically setting those structural areas of the TEI off-limits.

Similarly, if we want to expand where an element may go, we can do it by adding it to certain model classes, giving it permission to show up in those contexts as well.

So what change are these two examples making?

Root Element

A conformant TEI document must, of course, have as its root element TEI However, it is often convenient to use some other element (e.g., div) as the root element in an XML file.

This is most common either for debugging your ODD or for use in workflow in which some files are only a portion of a document.

version management

As a special detail, note the source attribute, which lets you specify what version of the TEI your element is being included from