DOMDocument-> saveHTML () konvertiert & nbsp; in den Weltraum

In meinem Code habe ich

<code>$document = DomDocument->loadHTML($someHTML);
$xPath = new DOMXPath($document);
//
//do some xpath query and processing
//
$result = $document->saveHTML();
</code>

Das HTML, das ich verarbeite, enthält:

<code><html>
<body>
<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;text-autospace:none"><b><span style='font-size:9.0pt;font-family:"ArialNarrow","sans-serif";
color:red'>&nbsp;</span></b></p>
</body>
</html>
</code>

und ergibt:

<code><html>
<body>
<p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:
normal;text-autospace:none"><b><span style='font-size:9.0pt;font-family:"ArialNarrow","sans-serif";
color:red'> </span></b></p>
</body>
</html>
</code>

Wie verhindere ich&nbsp; vom Umbau auf Leerzeichen?

Antworten auf die Frage(2)

Ihre Antwort auf die Frage