Content models: quantification

What is allowed inside an element?

  <content>
    
    <!-- 1 <head>: -->
    <elementRef key="head"/>
    
    <!-- 0 or 1 <label> (i.e., optional): -->
    <elementRef key="label" minOccurs="0" maxOccurs="1"/>
    
    <!-- 1 to 5 <gloss>s: -->
    <elementRef key="gloss" minOccurs="1" maxOccurs="5"/>
    
    <!-- 1 or more <desc>s (i.e., repeatable): -->
    <elementRef key="desc" minOccurs="1" maxOccurs="unbounded"/>
    
    <!-- 0 or more <note>s (i.e., optional and repeatable): -->
    <elementRef key="note" minOccurs="0" maxOccurs="unbounded"/>
    
  </content>

Let’s take a closer look at the part of the element specification where we define what the content of the element is. This definition makes use of a specialized vocabulary for referring to elements and controlling their behavior.

You can specify how many times an element can occur. You use the @minOccurs and and @maxOccurs attributes to specify how often a given element can occur inside of the one you’re defining.

Introduction to Writing ODDs slide 22 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.