1--TEST-- 2<template> element renaming 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7 8$html = <<<HTML 9<!DOCTYPE html> 10<html> 11 <body> 12 <template>a<div>foo</div>b</template> 13 </body> 14</html> 15HTML; 16$dom = Dom\HTMLDocument::createFromString($html); 17$template = $dom->body->firstElementChild; 18var_dump($template->innerHTML); 19 20try { 21 $template->rename($template->namespaceURI, 'screwthis'); 22} catch (DOMException $e) { 23 echo $e->getMessage(), "\n"; 24} 25 26// These shouldn't be changed! 27var_dump($template->nodeName); 28var_dump($template->innerHTML); 29 30?> 31--EXPECT-- 32string(16) "a<div>foo</div>b" 33It is not possible to rename the template element because it hosts a document fragment 34string(8) "TEMPLATE" 35string(16) "a<div>foo</div>b" 36