Trimming your modules

To delete specific elements from the modules you selected:

  <moduleRef key="namesdates" except="addName affiliation bloc climate"/>

To include specific elements from the modules you selected:

  <moduleRef key="textstructure" include="TEI text div back body"/>

Two important tips:

  • you can’t use both at once for the same <moduleRef>!
  • be careful that the elements listed are actually in the module specified!

So what if there’s a module that you want only some elements from? The TEI provides you with two mechanisms for trimming down modules by individual elements: with the @include and @except attributes (not exclude!!).

There are two things that are important to keep in mind when using these attributes. The first is that you cannot use both attributes on one <moduleRef>; you have to pick just one. You can, however, switch it up for different <moduleRef> elements, using @include on one and @except on the other.

The second thing to keep in mind is that spelling is important!! You may not immediately get an error message if you accidentally spell castList as catsList. But this will cause you problems later, when you try to generate a schema.

So what is the difference between using the @include and @except attributes (besides the fact that one includes the element names listed as values, and the other excludes them)? For one, you may choose one attribute for the sake of efficiency. If you want to include all but two elements from a given module, the @except attribute will probably be easier to manage.

However, it’s also useful to think about the TEI and how it changes over time. What would happen if you used the @include attribute for a given module, and the TEI added an element to that module? You wouldn’t get that new element when the TEI updated, because only the listed elements would be included in your schema. The same goes for the @except attribute, which may cause you to get new elements you don’t want.

This is not to say that you should necessarily choose one over the other; both options have their benefits and downsides. However, it is important to keep in mind that your customization applies to one version of the TEI, but since the TEI is constantly changing, your customization will need to be updated or cleaned out from time to time. The process of customization isn’t necessarily a one-time thing.

Introduction to Writing ODDs slide 04 of 24
© 2010 Syd Bauman, Julia Flanders, and the Women Writers Project This TEI-encoded XML file is available under the terms of the Creative Commons Attribution-ShareAlike 3.0 (Unported) license.