1--TEST-- 2Attribute entity expansion 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7$doc = Dom\HTMLDocument::createEmpty(); 8$elt = $doc->createElement('elt'); 9$doc->appendChild($elt); 10$elt->setAttribute('a','&'); 11print $doc->saveHtml($elt) . "\n"; 12 13$attr = $elt->getAttributeNode('a'); 14$attr->value = '&'; 15print "$attr->value\n"; 16print $doc->saveHtml($elt) . "\n"; 17 18$attr->removeChild($attr->firstChild); 19print $doc->saveHtml($elt) . "\n"; 20 21$attr->nodeValue = '&'; 22print "$attr->nodeValue\n"; 23print $doc->saveHtml($elt) . "\n"; 24 25$attr->nodeValue = '&'; 26print "$attr->nodeValue\n"; 27print $doc->saveHtml($elt) . "\n"; 28 29$elt->removeAttributeNode($attr); 30$elt->setAttributeNS('http://www.w3.org/2000/svg', 'svg:id','&'); 31print $doc->saveHtml($elt) . "\n"; 32 33$attr = $elt->getAttributeNodeNS('http://www.w3.org/2000/svg', 'id'); 34$attr->value = '<&'; 35print "$attr->value\n"; 36print $doc->saveHtml($elt) . "\n"; 37?> 38--EXPECT-- 39<elt a="&"></elt> 40& 41<elt a="&amp;"></elt> 42<elt a=""></elt> 43& 44<elt a="&"></elt> 45& 46<elt a="&amp;"></elt> 47<elt svg:id="&amp;"></elt> 48<& 49<elt svg:id="&lt;&amp;"></elt> 50