/** * Parse the portion of a spread.xml file that contains a <Page> * * @param DOMNode $domNode is a single <Page> node within the document */ public function parse($domNode) { $attributes = $domNode->attributes; $this->UID = $attributes->getNamedItem('Self')->value; // like 'ud3' $this->appliedMasterUID = $attributes->getNamedItem('AppliedMaster')->value; // like 'ud3' or 'n' $this->inDesignPageName = $attributes->getNamedItem('Name')->value; // ordinary pages are numbers, master spreads are letters $itemTransform = $attributes->getNamedItem('ItemTransform')->value; // like "1 0 0 1 0 -396" $masterPageTransform = $attributes->getNamedItem('MasterPageTransform')->value; // like "1 0 0 1 0 0" $geometricBounds = $attributes->getNamedItem('GeometricBounds')->value; // like "0 0 792 612" $overrideList = $attributes->getNamedItem('OverrideList')->value; // like "ufb u174" $this->transformation = new IdmlTransformation($itemTransform); $this->masterPageTransform = new IdmlTransformation($masterPageTransform); $this->boundary = IdmlBoundary::createFromIDMLString($geometricBounds); $this->idssCoordinates = IdmlBoundary::transform($this->boundary, $this->transformation); if ($overrideList != '') { $this->masterSpreadOverrides = explode(' ', $overrideList); } $pageX = $this->transformation->xTranslate(); if ($pageX < 0) { $this->pagePosition = 'left'; } else { $this->pagePosition = 'right'; } // Increment progress step. $p = IdmlAssembler::getProgressUpdater(); if ($p) { $p->incrementStep(); } }