protected function unmarshall(DOMElement $element)
    {
        if (($shape = $this->getDOMElementAttributeAs($element, 'shape')) !== null) {

            $shapeVal = QtiShape::getConstantByName($shape);

            if ($shapeVal !== false) {

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

                    try {
                        $coords = Utils::stringToCoords($coords, $shapeVal);

                        if (($mappedValue = $this->getDOMElementAttributeAs($element, 'mappedValue', 'float')) !== null) {
                            return new AreaMapEntry($shapeVal, $coords, $mappedValue);
                        } else {
                            $msg = "The mandatory attribute 'mappedValue' is missing from element '" . $element->localName . "'.";
                            throw new UnmarshallingException($msg, $element);
                        }
                    } catch (Exception $e) {
                        if (!$e instanceof UnmarshallingException) {
                            $msg = "The attribute 'coords' with value '${coords}' has an invalid value.";
                            throw new UnmarshallingException($msg, $element, $e);
                        } else {
                            throw $e;
                        }
                    }
                } else {
                    $msg = "The mandatory attribute 'coords' is missing from element '" . $element->localName . "'.";
                    throw new UnmarshallingException($msg, $element);
                }
            } else {
                $msg = "The 'shape' attribute value '${shape}' is not a valid value to represent QTI shapes.";
                throw new UnmarshallingException($msg, $element);
            }

        } else {
            $msg = "The mandatory attribute 'shape' is missing from element '" . $element->localName . "'.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall(DOMElement $element)
    {
        if (($shape = $this->getDOMElementAttributeAs($element, 'shape')) !== null) {

            $shapeVal = QtiShape::getConstantByName($shape);

            if ($shapeVal !== false) {

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

                    try {
                        $coords = Utils::stringToCoords($coords, $shapeVal);

                        if (($mappedValue = $this->getDOMElementAttributeAs($element, 'mappedValue', 'float')) !== null) {
                            return new AreaMapEntry($shapeVal, $coords, $mappedValue);
                        } else {
                            $msg = "The mandatory attribute 'mappedValue' is missing from element '" . $element->localName . "'.";
                            throw new UnmarshallingException($msg, $element);
                        }
                    } catch (Exception $e) {
                        if (!$e instanceof UnmarshallingException) {
                            $msg = "The attribute 'coords' with value '${coords}' has an invalid value.";
                            throw new UnmarshallingException($msg, $element, $e);
                        } else {
                            throw $e;
                        }
                    }
                } else {
                    $msg = "The mandatory attribute 'coords' is missing from element '" . $element->localName . "'.";
                    throw new UnmarshallingException($msg, $element);
                }
            } else {
                $msg = "The 'shape' attribute value '${shape}' is not a valid value to represent QTI shapes.";
                throw new UnmarshallingException($msg, $element);
            }

        } else {
            $msg = "The mandatory attribute 'shape' is missing from element '" . $element->localName . "'.";
            throw new UnmarshallingException($msg, $element);
        }
    }
protected function unmarshall ( DOMElement $ element ) { if ( ( $ shape = $ this -> getDOMElementAttributeAs ( $ element , 'shape' ) ) !== null ) { $ shapeVal = QtiShape :: getConstantByName ( $ shape ) ; if ( $ shapeVal !== false ) { if ( ( $ coords = $ this -> getDOMElementAttributeAs ( $ element , 'coords' ) ) !== null ) { try { $ coords = Utils :: stringToCoords ( $ coords , $ shapeVal ) ; if ( ( $ mappedValue = $ this -> getDOMElementAttributeAs ( $ element , 'mappedValue' , 'float' ) ) !== null ) { return new AreaMapEntry ( $ shapeVal , $ coords , $ mappedValue ) ; } else { $ msg = "The mandatory attribute 'mappedValue' is missing from element '" . $ element -> localName . "'." ; throw new UnmarshallingException ( $ msg , $ element ) ; } } catch ( Exception $ e ) { if ( ! $ e instanceof UnmarshallingException ) { $ msg = "The attribute 'coords' with value '${coords}' has an invalid value." ; throw new UnmarshallingException ( $ msg , $ element , $ e ) ; } else { throw $ e ; } } } else { $ msg = "The mandatory attribute 'coords' is missing from element '" . $ element -> localName . "'." ; throw new UnmarshallingException ( $ msg , $ element ) ; } } else { $ msg = "The 'shape' attribute value '${shape}' is not a valid value to represent QTI shapes." ; throw new UnmarshallingException ( $ msg , $ element ) ; } } else { $ msg = "The mandatory attribute 'shape' is missing from element '" . $ element -> localName . "'." ; throw new UnmarshallingException ( $ msg , $ element ) ; } }
Unmarshall a DOMElement object corresponding to a QTI areaMapEntry element.

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