protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement($component->getQtiClassName());

        if ($component->hasTemplate() === true) {
            $this->setDOMElementAttribute($element, 'template', $component->getTemplate());
        }

        if ($component->hasTemplateLocation() === true) {
            $this->setDOMElementAttribute($element, 'templateLocation', $component->getTemplateLocation());
        }

        foreach ($component->getResponseRules() as $responseRule) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseRule);
            $element->appendChild($marshaller->marshall($responseRule));
        }

        return $element;
    }
protected function marshall(QtiComponent $component)
    {
        $element = self::getDOMCradle()->createElement($component->getQtiClassName());

        if ($component->hasTemplate() === true) {
            $this->setDOMElementAttribute($element, 'template', $component->getTemplate());
        }

        if ($component->hasTemplateLocation() === true) {
            $this->setDOMElementAttribute($element, 'templateLocation', $component->getTemplateLocation());
        }

        foreach ($component->getResponseRules() as $responseRule) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseRule);
            $element->appendChild($marshaller->marshall($responseRule));
        }

        return $element;
    }
protected function marshall ( QtiComponent $ component ) { $ element = self :: getDOMCradle ( ) -> createElement ( $ component -> getQtiClassName ( ) ) ; if ( $ component -> hasTemplate ( ) === true ) { $ this -> setDOMElementAttribute ( $ element , 'template' , $ component -> getTemplate ( ) ) ; } if ( $ component -> hasTemplateLocation ( ) === true ) { $ this -> setDOMElementAttribute ( $ element , 'templateLocation' , $ component -> getTemplateLocation ( ) ) ; } foreach ( $ component -> getResponseRules ( ) as $ responseRule ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ responseRule ) ; $ element -> appendChild ( $ marshaller -> marshall ( $ responseRule ) ) ; } return $ element ; }
Marshall a ResponseProcessing object into a DOMElement object.

@param \qtism\data\QtiComponent $component A ResponseProcessing object.
@return \DOMElement The according DOMElement object.
@throws \qtism\data\storage\xml\marshalling\MarshallingException
Marshall a ResponseProcessing object into a DOMElement object .