ArticleMedraXmlFilter::process PHP Method

process() public method

See also: Filter::process()
public process ( &$pubObjects ) : DOMDocument
$pubObjects array Array of PublishedArticles or ArticleGalleys
return DOMDocument
    function &process(&$pubObjects)
    {
        // Create the XML document
        $doc = new DOMDocument('1.0', 'utf-8');
        $doc->preserveWhiteSpace = false;
        $doc->formatOutput = true;
        $deployment = $this->getDeployment();
        $context = $deployment->getContext();
        // Create the root node
        $rootNode = $this->createRootNode($doc, $this->getRootNodeName());
        $doc->appendChild($rootNode);
        // Create and appet the header node and all parts inside it
        $rootNode->appendChild($this->createHeadNode($doc));
        // Create and append the article nodes,
        // containing all article information
        foreach ($pubObjects as $pubObject) {
            $rootNode->appendChild($this->createArticleNode($doc, $pubObject));
        }
        return $doc;
    }