/**
  * Unmarshall a DOMElement object corresponding to a QTI outcomeDeclaration element.
  * 
  * @param DOMElement $element A DOMElement object.
  * @return QtiComponent An OutcomeDeclaration object.
  * @throws UnmarshallingException 
  */
 protected function unmarshall(DOMElement $element)
 {
     try {
         $baseComponent = parent::unmarshall($element);
         $object = new OutcomeDeclaration($baseComponent->getIdentifier());
         $object->setBaseType($baseComponent->getBaseType());
         $object->setCardinality($baseComponent->getCardinality());
         $object->setDefaultValue($baseComponent->getDefaultValue());
         // deal with views.
         if (($views = static::getDOMElementAttributeAs($element, 'view')) != null) {
             $viewCollection = new ViewCollection();
             foreach (explode(" ", $views) as $viewName) {
                 $viewCollection[] = View::getConstantByName($viewName);
             }
             $object->setViews($viewCollection);
         }
         // deal with interpretation.
         if (($interpretation = static::getDOMElementAttributeAs($element, 'interpretation')) != null) {
             $object->setInterpretation($interpretation);
         }
         // deal with longInterpretation.
         if (($longInterpretation = static::getDOMElementAttributeAs($element, 'longInterpretation')) != null) {
             $object->setLongInterpretation($longInterpretation);
         }
         // deal with normalMaximum.
         if (($normalMaximum = static::getDOMElementAttributeAs($element, 'normalMaximum', 'float')) !== null) {
             $object->setNormalMaximum($normalMaximum);
         }
         // deal with normalMinimum.
         if (($normalMinimum = static::getDOMElementAttributeAs($element, 'normalMinimum', 'float')) !== null) {
             $object->setNormalMinimum($normalMinimum);
         }
         // deal with matseryValue.
         if (($masteryValue = static::getDOMElementAttributeAs($element, 'masteryValue', 'float')) !== null) {
             $object->setMasteryValue($masteryValue);
         }
         // deal with lookupTable.
         $interpolationTables = $element->getElementsByTagName('interpolationTable');
         $matchTable = $element->getElementsByTagName('matchTable');
         if ($interpolationTables->length == 1 || $matchTable->length == 1) {
             // we have a lookupTable defined.
             $lookupTable = null;
             if ($interpolationTables->length == 1) {
                 $lookupTable = $interpolationTables->item(0);
             } else {
                 $lookupTable = $matchTable->item(0);
             }
             $lookupTableMarshaller = $this->getMarshallerFactory()->createMarshaller($lookupTable, array($object->getBaseType()));
             $object->setLookupTable($lookupTableMarshaller->unmarshall($lookupTable));
         }
         return $object;
     } catch (InvalidArgumentException $e) {
         $msg = "An unexpected error occured while unmarshalling the outcomeDeclaration.";
         throw new UnmarshallingException($msg, $element, $e);
     }
 }