Web Languages - Solutions to Exercises

  1. One representation is as follows:
    <programme>
      <degree>MSc</degree>
      <year>2015/16</year>
      <results>
        <distinction>
          <name>Jemima Puddle-Duck</name>
          <name>Peter Rabbit</name>
        </distinction>
        <merit>
          <name>Tom Kitten</name>
        </merit>
        <pass/>
        <fail>
          <name>Samuel Whiskers</name>
        </fail>
      </results>
    </programme>
    
    The empty <pass/> element could be omitted.


  2. One representation is as follows:
    <teaches-relationship>
      <teaches>
        <course>ADM</course>
        <lecturer>Alex Poulovassilis</lecturer>
      </teaches>
      <teaches>
        <course>IWT</course>
        <lecturer>Peter Wood</lecturer>
      </teaches>
    </teaches-relationship>
    
    Alternatively, attributes could have been used instead of elements, e.g.:
    <teaches-relationship>
      <teaches course="ADM" lecturer="Alex Poulovassilis"/>
      <teaches course="IWT" lecturer="Peter Wood"/>
    </teaches-relationship>