public function setXmlDeclaration($xmldec, $called_from_macro)
    {
        // FIXME
        if (!$this->_xmlDeclaration) {
            $this->_xmlDeclaration = $xmldec;
        }

        if ($this->_parentContext) {
            $this->_parentContext->setXmlDeclaration($xmldec, $called_from_macro);
        } else if ($this->_echoDeclarations) {
            if (!$called_from_macro) {
                echo $xmldec."\n";
            } else {
                throw new PHPTAL_ConfigurationException("Executed macro in file with XML declaration when using echoExecute(). This is not supported yet. Remove XML declaration or use PHPTAL->execute().");
            }
        } else if (!$this->_xmlDeclaration) {
            $this->_xmlDeclaration = $xmldec;
        }
    }
public function setXmlDeclaration($xmldec, $called_from_macro)
    {
        // FIXME
        if (!$this->_xmlDeclaration) {
            $this->_xmlDeclaration = $xmldec;
        }

        if ($this->_parentContext) {
            $this->_parentContext->setXmlDeclaration($xmldec, $called_from_macro);
        } else if ($this->_echoDeclarations) {
            if (!$called_from_macro) {
                echo $xmldec."\n";
            } else {
                throw new PHPTAL_ConfigurationException("Executed macro in file with XML declaration when using echoExecute(). This is not supported yet. Remove XML declaration or use PHPTAL->execute().");
            }
        } else if (!$this->_xmlDeclaration) {
            $this->_xmlDeclaration = $xmldec;
        }
    }
public function setXmlDeclaration ( $ xmldec , $ called_from_macro ) { // FIXME if ( ! $ this -> _xmlDeclaration ) { $ this -> _xmlDeclaration = $ xmldec ; } if ( $ this -> _parentContext ) { $ this -> _parentContext -> setXmlDeclaration ( $ xmldec , $ called_from_macro ) ; } else if ( $ this -> _echoDeclarations ) { if ( ! $ called_from_macro ) { echo $ xmldec . "\n" ; } else { throw new PHPTAL_ConfigurationException ( "Executed macro in file with XML declaration when using echoExecute(). This is not supported yet. Remove XML declaration or use PHPTAL->execute()." ) ; } } else if ( ! $ this -> _xmlDeclaration ) { $ this -> _xmlDeclaration = $ xmldec ; } }
Set output document xml declaration.

This method ensure PHPTAL uses the first xml declaration encountered
(main template or any macro template source containing an xml
declaration)

@param bool $called_from_macro will do nothing if _echoDeclarations is also set

@return void
Set output document xml declaration .