public function __construct($version = '1.0', $encoding = 'utf-8', $dtd = 'html') { //}, DOMDocumentType $dtd=NULL){ parent::__construct($version, $encoding); $this->registerNodeClass('DOMDocument', 'HTMLDocument'); $this->registerNodeClass('DOMElement', 'SymphonyDOMElement'); $this->appendChild($this->createElement('html')); /*$this->loadHTML( sprintf("%s\n<html/>", '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' )); */ $this->Headers = new DocumentHeaders(array('Content-Type', "text/html; charset={$encoding}")); $this->dtd = $dtd; //if(is_null($dtd)){ // $dtd = DOMImplementation::createDocumentType('html'); //} //$this->Document = DOMImplementation::createDocument(NULL, 'html', $dtd); //$this->version = $version; //$this->encoding = $encoding; $this->preserveWhitespace = false; $this->formatOutput = true; $this->Html = $this->documentElement; $this->Head = $this->createElement('head'); $this->Html->appendChild($this->Head); $this->Body = $this->createElement('body'); $this->Html->appendChild($this->Body); }
/** * Constructor * * @param string $encoding */ public function __construct($encoding = 'utf-8') { $imp = new \DOMImplementation(); $dtd = $imp->createDocumentType('html', null, null); $this->doc = $imp->createDocument('', '', $dtd); unset($dtd, $imp); parent::__construct(null, $encoding); }
public function __construct() { global $c; parent::__construct(array(ATOM_XMLNS => null, XHTML_XMLNS => 'xhtml')); $this->title = 'DAViCal Atom Feed'; $this->nodes = array('id', 'title', 'updated', new XMLElement('generator', 'DAViCal', array('uri' => 'http://www.davical.org/', 'version' => $c->version_string))); }