protected function unmarshall(DOMElement $element)
    {
        // Retrieve XML content as a string.
        $frag = $element->ownerDocument->createDocumentFragment();
        $element = $element->cloneNode(true);
        $frag->appendChild($element);
        $xmlString = $frag->ownerDocument->saveXML($frag);
        
        // select is a mandatory value, retrieve it first.
        if (($value = $this->getDOMElementAttributeAs($element, 'select', 'integer')) !== null) {
            $withReplacement = false;
            
            if (($withReplacementValue = $this->getDOMElementAttributeAs($element, 'withReplacement', 'boolean')) !== null) {
                $withReplacement = $withReplacementValue;
            }
            
            $object = new Selection($value, $withReplacement, $xmlString);
            
        } else {
            $msg = "The mandatory attribute 'select' is missing.";
            throw new UnmarshallingException($msg, $element);
        }

        return $object;
    }
protected function unmarshall(DOMElement $element)
    {
        // Retrieve XML content as a string.
        $frag = $element->ownerDocument->createDocumentFragment();
        $element = $element->cloneNode(true);
        $frag->appendChild($element);
        $xmlString = $frag->ownerDocument->saveXML($frag);
        
        // select is a mandatory value, retrieve it first.
        if (($value = $this->getDOMElementAttributeAs($element, 'select', 'integer')) !== null) {
            $withReplacement = false;
            
            if (($withReplacementValue = $this->getDOMElementAttributeAs($element, 'withReplacement', 'boolean')) !== null) {
                $withReplacement = $withReplacementValue;
            }
            
            $object = new Selection($value, $withReplacement, $xmlString);
            
        } else {
            $msg = "The mandatory attribute 'select' is missing.";
            throw new UnmarshallingException($msg, $element);
        }

        return $object;
    }
protected function unmarshall ( DOMElement $ element ) { // Retrieve XML content as a string. $ frag = $ element -> ownerDocument -> createDocumentFragment ( ) ; $ element = $ element -> cloneNode ( true ) ; $ frag -> appendChild ( $ element ) ; $ xmlString = $ frag -> ownerDocument -> saveXML ( $ frag ) ; // select is a mandatory value, retrieve it first. if ( ( $ value = $ this -> getDOMElementAttributeAs ( $ element , 'select' , 'integer' ) ) !== null ) { $ withReplacement = false ; if ( ( $ withReplacementValue = $ this -> getDOMElementAttributeAs ( $ element , 'withReplacement' , 'boolean' ) ) !== null ) { $ withReplacement = $ withReplacementValue ; } $ object = new Selection ( $ value , $ withReplacement , $ xmlString ) ; } else { $ msg = "The mandatory attribute 'select' is missing." ; throw new UnmarshallingException ( $ msg , $ element ) ; } return $ object ; }
Unmarshall a DOMElement object corresponding to a QTI Selection object.

@param \DOMElement $element A DOMElement object.
@return \qtism\data\QtiComponent A Selection object.
@throws \qtism\data\storage\xml\marshalling\UnmarshallingException If the mandatory 'select' attribute is missing from $element.
Unmarshall a DOMElement object corresponding to a QTI Selection object .