This is the code related to the problem:
$prep = "<select><option>Option 1</option><option selected>Option 1</option></select>"
$td = $dom->createElement('td',$prep);
Solution:
$f = $this->dom->createDocumentFragment();
$f->appendXML($prep);
BUT still a big problem. Any attributes without value ex: selected
, disabled
(which you can't write as selected="selected"
) the createElement
doesn't allow you to do so.
How can use attributes without value, and not get 1000 erros like now:
Warning: DOMDocumentFragment::appendXML() [domdocumentfragment.appendxml]: Entity: line 1: parser error : Specification mandate value for attribute selected
Warning: DOMDocumentFragment::appendXML() [domdocumentfragment.appendxml]: Entity: line 2: parser error : chunk is not well balanced
This happens when passing a selected
attribute, or disabled.