Ejemplo n.º 1
0
 /**
  * Parse children. We override this because the xml DOM hierarchy has rows, columns, and cells as children of table
  * we need to change the idml element hierarchy so tables are parents of rows which are parents of cells
  * @param DOMElement $parentNode
  */
 protected function parseChildren($parentNode)
 {
     foreach ($parentNode->childNodes as $childNode) {
         if (IdmlParserHelper::isParsableChildIdmlObjectNode($childNode)) {
             $parsableObject = IdmlElementFactory::createFromNode($childNode);
             if (is_object($parsableObject)) {
                 //set the parent first since sometimes parse requires or sets parent data
                 $parsableObject->parentElement = $this;
                 if (!IdmlParserHelper::isIdmlTagNode($childNode) && IdmlParserHelper::getIdmlObjectType($parsableObject) != "TableCell") {
                     $this->childrenElements[] = $parsableObject;
                     //don't set IdmlTable as parent for IdmlTableCell
                 }
                 $parsableObject->parse($childNode);
             }
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Parse children.
  * 
  * @param DOMNode $parentNode
  */
 private function parseChildren($parentNode)
 {
     //same logic/code as for IdmlElement method - more comprehensive and easier to maintain
     foreach ($parentNode->childNodes as $childNode) {
         if (IdmlParserHelper::isParsableChildIdmlObjectNode($childNode)) {
             if (Configure::read("dev.idmlHtmlDebugOutput") == true) {
                 CakeLog::debug(sprintf("[IdmlStory::parseChildren] Parse Story %8s %30s --> %sKb", $this->UID, $childNode->nodeName, round(memory_get_usage(true) / 1024)));
             }
             $parsableObject = IdmlElementFactory::createFromNode($childNode);
             //we must set the parent before parsing since children need parent
             $parsableObject->parentElement = $this;
             $parsableObject->parse($childNode);
             $this->childrenElements[] = $parsableObject;
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Parse children.
  * @param DOMElement $parentNode
  */
 protected function parseChildren($parentNode)
 {
     foreach ($parentNode->childNodes as $childNode) {
         if (IdmlParserHelper::isParsableChildIdmlObjectNode($childNode)) {
             $parsableObject = IdmlElementFactory::createFromNode($childNode);
             if (is_object($parsableObject)) {
                 //set the parent first since sometimes parse requires or sets parent data
                 $parsableObject->parentElement = $this;
                 //set this parsable child object as a child of the parent (bypassing xml parent)
                 $this->childrenElements[] = $parsableObject;
                 $parsableObject->parse($childNode);
             }
         }
     }
 }