protected function unmarshall(DOMElement $element)
    {
        try {
            $mapKey = $this->getDOMElementAttributeAs($element, 'mapKey');
            $mapKey = Utils::stringToDatatype($mapKey, $this->getBaseType());

            if (($mappedValue = $this->getDOMElementAttributeAs($element, 'mappedValue', 'float')) !== null) {

                $object = new MapEntry($mapKey, $mappedValue);

                if (Version::compare($this->getVersion(), '2.0.0', '>') && ($caseSensitive = $this->getDOMElementAttributeAs($element, 'caseSensitive', 'boolean')) !== null) {
                    $object->setCaseSensitive($caseSensitive);
                }

                return $object;
            } else {
                $msg = "The mandatory 'mappedValue' attribute is missing from element '" . $element->nodeName . "'.";
                throw new UnmarshallingException($msg, $element);
            }
        } catch (UnexpectedValueException $e) {
            $msg = "The value '${mapKey}' of the 'mapKey' attribute could not be converted to a '" . BaseType::getNameByConstant($this->getBaseType()) . "' value.";
            throw new UnmarshallingException($msg, $element, $e);
        }
    }
protected function unmarshall(DOMElement $element)
    {
        try {
            $mapKey = $this->getDOMElementAttributeAs($element, 'mapKey');
            $mapKey = Utils::stringToDatatype($mapKey, $this->getBaseType());

            if (($mappedValue = $this->getDOMElementAttributeAs($element, 'mappedValue', 'float')) !== null) {

                $object = new MapEntry($mapKey, $mappedValue);

                if (Version::compare($this->getVersion(), '2.0.0', '>') && ($caseSensitive = $this->getDOMElementAttributeAs($element, 'caseSensitive', 'boolean')) !== null) {
                    $object->setCaseSensitive($caseSensitive);
                }

                return $object;
            } else {
                $msg = "The mandatory 'mappedValue' attribute is missing from element '" . $element->nodeName . "'.";
                throw new UnmarshallingException($msg, $element);
            }
        } catch (UnexpectedValueException $e) {
            $msg = "The value '${mapKey}' of the 'mapKey' attribute could not be converted to a '" . BaseType::getNameByConstant($this->getBaseType()) . "' value.";
            throw new UnmarshallingException($msg, $element, $e);
        }
    }
protected function unmarshall ( DOMElement $ element ) { try { $ mapKey = $ this -> getDOMElementAttributeAs ( $ element , 'mapKey' ) ; $ mapKey = Utils :: stringToDatatype ( $ mapKey , $ this -> getBaseType ( ) ) ; if ( ( $ mappedValue = $ this -> getDOMElementAttributeAs ( $ element , 'mappedValue' , 'float' ) ) !== null ) { $ object = new MapEntry ( $ mapKey , $ mappedValue ) ; if ( Version :: compare ( $ this -> getVersion ( ) , '2.0.0' , '>' ) && ( $ caseSensitive = $ this -> getDOMElementAttributeAs ( $ element , 'caseSensitive' , 'boolean' ) ) !== null ) { $ object -> setCaseSensitive ( $ caseSensitive ) ; } return $ object ; } else { $ msg = "The mandatory 'mappedValue' attribute is missing from element '" . $ element -> nodeName . "'." ; throw new UnmarshallingException ( $ msg , $ element ) ; } } catch ( UnexpectedValueException $ e ) { $ msg = "The value '${mapKey}' of the 'mapKey' attribute could not be converted to a '" . BaseType :: getNameByConstant ( $ this -> getBaseType ( ) ) . "' value." ; throw new UnmarshallingException ( $ msg , $ element , $ e ) ; } }
Unmarshall a DOMElement object corresponding to a QTI mapEntry element.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A MapEntry object.
@throws \qtism\data\storage\xml\marshalling\UnmarshallingException
Unmarshall a DOMElement object corresponding to a QTI mapEntry element .