/**
  * Unmarshall a DOMElement object corresponding to a textEntryInteraction/extendedTextInteraction element.
  * 
  * @param DOMElement $element A DOMElement object.
  * @return QtiComponent A TextEntryInteraction/ExtendedTextInteraction object.
  * @throws UnmarshallingException
  */
 protected function unmarshall(DOMElement $element)
 {
     if (($responseIdentifier = self::getDOMElementAttributeAs($element, 'responseIdentifier')) !== null) {
         try {
             $class = 'qtism\\data\\content\\interactions\\' . ucfirst($element->localName);
             $component = new $class($responseIdentifier);
         } catch (InvalidArgumentException $e) {
             $msg = "The value '{$responseIdentifier}' of the 'responseIdentifier' attribute of the '" . $element->localName . "' element is not a valid identifier.";
             throw new UnmarshallingException($msg, $element, $e);
         }
         if (($base = self::getDOMElementAttributeAs($element, 'base', 'integer')) !== null) {
             $component->setBase($base);
         }
         if (($stringIdentifier = self::getDOMElementAttributeAs($element, 'stringIdentifier')) !== null) {
             $component->setStringIdentifier($stringIdentifier);
         }
         if (($expectedLength = self::getDOMElementAttributeAs($element, 'expectedLength', 'integer')) !== null) {
             $component->setExpectedLength($expectedLength);
         }
         if (($patternMask = self::getDOMElementAttributeAs($element, 'patternMask')) !== null) {
             $component->setPatternMask($patternMask);
         }
         if (($placeholderText = self::getDOMElementAttributeAs($element, 'placeholderText')) !== null) {
             $component->setPlaceholderText($placeholderText);
         }
         if (($xmlBase = self::getXmlBase($element)) !== false) {
             $component->setXmlBase($xmlBase);
         }
         if ($element->localName === 'extendedTextInteraction') {
             if (($maxStrings = self::getDOMElementAttributeAs($element, 'maxStrings', 'integer')) !== null) {
                 $component->setMaxStrings($maxStrings);
             }
             if (($minStrings = self::getDOMElementAttributeAs($element, 'minStrings', 'integer')) !== null) {
                 $component->setMinStrings($minStrings);
             }
             if (($expectedLines = self::getDOMElementAttributeAs($element, 'expectedLines', 'integer')) !== null) {
                 $component->setExpectedLines($expectedLines);
             }
             if (($format = self::getDOMElementAttributeAs($element, 'format')) !== null) {
                 $component->setFormat(TextFormat::getConstantByName($format));
             }
             $promptElts = self::getChildElementsByTagName($element, 'prompt');
             if (count($promptElts) > 0) {
                 $component->setPrompt($this->getMarshallerFactory()->createMarshaller($promptElts[0])->unmarshall($promptElts[0]));
             }
         }
         self::fillBodyElement($component, $element);
         return $component;
     } else {
         $msg = "The mandatory 'responseIdentifier' attribute is missing from the '" . $element->localName . "' element.";
         throw new UnmarshallingException($msg, $element);
     }
 }