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

        if ($component->hasSummary() === true) {
            $this->setDOMElementAttribute($element, 'summary', $component->getSummary());
        }

        if ($component->hasXmlBase() === true) {
            self::setXmlBase($element, $component->getXmlBase());
        }

        if ($component->hasCaption() === true) {
            $caption = $component->getCaption();
            $marshaller = $this->getMarshallerFactory()->createMarshaller($caption);
            $element->appendChild($marshaller->marshall($caption));
        }

        $cols = $component->getCols();
        if (count($cols) > 0) {
            foreach ($cols as $c) {
                $marshaller = $this->getMarshallerFactory()->createMarshaller($c);
                $element->appendChild($marshaller->marshall($c));
            }
        }

        $colgroups = $component->getColgroups();
        if (count($colgroups) > 0) {
            foreach ($colgroups as $c) {
                $marshaller = $this->getMarshallerFactory()->createMarshaller($c);
                $element->appendChild($marshaller->marshall($c));
            }
        }

        if ($component->hasThead() === true) {
            $thead = $component->getThead();
            $marshaller = $this->getMarshallerFactory()->createMarshaller($thead);
            $element->appendChild($marshaller->marshall($thead));
        }

        if ($component->hasTfoot() === true) {
            $tfoot = $component->getTfoot();
            $marshaller = $this->getMarshallerFactory()->createMarshaller($tfoot);
            $element->appendChild($marshaller->marshall($tfoot));
        }

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

        $this->fillElement($element, $component);

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

        if ($component->hasSummary() === true) {
            $this->setDOMElementAttribute($element, 'summary', $component->getSummary());
        }

        if ($component->hasXmlBase() === true) {
            self::setXmlBase($element, $component->getXmlBase());
        }

        if ($component->hasCaption() === true) {
            $caption = $component->getCaption();
            $marshaller = $this->getMarshallerFactory()->createMarshaller($caption);
            $element->appendChild($marshaller->marshall($caption));
        }

        $cols = $component->getCols();
        if (count($cols) > 0) {
            foreach ($cols as $c) {
                $marshaller = $this->getMarshallerFactory()->createMarshaller($c);
                $element->appendChild($marshaller->marshall($c));
            }
        }

        $colgroups = $component->getColgroups();
        if (count($colgroups) > 0) {
            foreach ($colgroups as $c) {
                $marshaller = $this->getMarshallerFactory()->createMarshaller($c);
                $element->appendChild($marshaller->marshall($c));
            }
        }

        if ($component->hasThead() === true) {
            $thead = $component->getThead();
            $marshaller = $this->getMarshallerFactory()->createMarshaller($thead);
            $element->appendChild($marshaller->marshall($thead));
        }

        if ($component->hasTfoot() === true) {
            $tfoot = $component->getTfoot();
            $marshaller = $this->getMarshallerFactory()->createMarshaller($tfoot);
            $element->appendChild($marshaller->marshall($tfoot));
        }

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

        $this->fillElement($element, $component);

        return $element;
    }
protected function marshall ( QtiComponent $ component ) { $ element = self :: getDOMCradle ( ) -> createElement ( 'table' ) ; if ( $ component -> hasSummary ( ) === true ) { $ this -> setDOMElementAttribute ( $ element , 'summary' , $ component -> getSummary ( ) ) ; } if ( $ component -> hasXmlBase ( ) === true ) { self :: setXmlBase ( $ element , $ component -> getXmlBase ( ) ) ; } if ( $ component -> hasCaption ( ) === true ) { $ caption = $ component -> getCaption ( ) ; $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ caption ) ; $ element -> appendChild ( $ marshaller -> marshall ( $ caption ) ) ; } $ cols = $ component -> getCols ( ) ; if ( count ( $ cols ) > 0 ) { foreach ( $ cols as $ c ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ c ) ; $ element -> appendChild ( $ marshaller -> marshall ( $ c ) ) ; } } $ colgroups = $ component -> getColgroups ( ) ; if ( count ( $ colgroups ) > 0 ) { foreach ( $ colgroups as $ c ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ c ) ; $ element -> appendChild ( $ marshaller -> marshall ( $ c ) ) ; } } if ( $ component -> hasThead ( ) === true ) { $ thead = $ component -> getThead ( ) ; $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ thead ) ; $ element -> appendChild ( $ marshaller -> marshall ( $ thead ) ) ; } if ( $ component -> hasTfoot ( ) === true ) { $ tfoot = $ component -> getTfoot ( ) ; $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ tfoot ) ; $ element -> appendChild ( $ marshaller -> marshall ( $ tfoot ) ) ; } foreach ( $ component -> getTbodies ( ) as $ tbody ) { $ marshaller = $ this -> getMarshallerFactory ( ) -> createMarshaller ( $ tbody ) ; $ element -> appendChild ( $ marshaller -> marshall ( $ tbody ) ) ; } $ this -> fillElement ( $ element , $ component ) ; return $ element ; }
Marshall a Table object into a DOMElement object.

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