Example #1
0
 public function testAppendDoctypeAndValidateWithReload()
 {
     $implementation = new DomImplementation();
     $type = $implementation->createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
     $document = new DomDocument();
     $document->appendChild($type);
     $html = $document->addElementNS('http://www.w3.org/1999/xhtml', 'html');
     $head = $html->addElement('head');
     $head->addElement('title');
     $html->addElement('body');
     $document->reload();
     $this->assertTrue($document->validate());
 }
Example #2
0
 /**
  * @param \DomNode $node Domnode.
  * @return self
  */
 public function appendChild(PhpDomNode $node)
 {
     parent::appendChild($node);
     $this->registerPendingNamespaces();
     return $this;
 }