示例#1
0
 /**
  * Processes the opt:root node.
  * @internal
  * @param Opt_Xml_Node $node The recognized node.
  */
 public function processNode(Opt_Xml_Node $node)
 {
     if ($node->getParent()->getType() != 'Opt_Xml_Root') {
         throw new Opt_InstructionInvalidParent_Exception($node->getXmlName(), 'ROOT');
     }
     $params = array('escaping' => array(0 => self::OPTIONAL, self::BOOL, NULL), 'include' => array(0 => self::OPTIONAL, self::STRING, NULL), 'dynamic' => array(0 => self::OPTIONAL, self::BOOL, false));
     $this->_extractAttributes($node, $params);
     // Compile-time inclusion support
     if (!is_null($params['include'])) {
         $file = $params['include'];
         if ($params['dynamic']) {
             if (is_null($file = $this->_compiler->inherits($this->_compiler->get('currentTemplate')))) {
                 $file = $params['include'];
             }
         }
         $this->_compiler->addDependantTemplate($file);
         $compiler = new Opt_Compiler_Class($this->_compiler);
         $compiler->compile($this->_tpl->_getSource($file), $file, NULL, $this->_compiler->get('mode'));
         $this->_compiler->importDependencies($compiler);
     }
     // Escaping control support
     if (!is_null($params['escaping'])) {
         $this->_compiler->set('escaping', $params['escaping']);
     }
     $this->_process($node);
 }