1--TEST--
2Serialize entity reference within attribute
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7
8$xml = Dom\XMLDocument::createFromString(<<<XML
9<!DOCTYPE root [
10    <!ENTITY foo "foo">
11]>
12<root><el x="&foo;bar&foo;"/></root>
13XML);
14
15$el = $xml->documentElement->firstChild;
16echo $xml->saveXml(), "\n";
17
18$html = Dom\HTMLDocument::createEmpty();
19$html->append($html->importNode($el, true));
20echo $html->saveHtml(), "\n";
21
22?>
23--EXPECT--
24<?xml version="1.0" encoding="UTF-8"?>
25<!DOCTYPE root [
26<!ENTITY foo "foo">
27]>
28<root><el x="&foo;bar&foo;"/></root>
29<el x="&foo;bar&foo;"></el>
30