Forum: Ruby How to make REXML respect   (in 1.9)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Phlip (Guest)
on 2008-11-08 16:16
(Received via mailing list)

This fails on the second line...'<b>&amp;</b>')'<b>&nbsp;</b>')

...with Undeclared entity '&nbsp;'

If I make that real XHTML, with a DOCTYPE and a html xmlns="...xhtml",
still fails.

I fixed the &nbsp; itself by adding [<!ENTITY nbsp " ">] to the DOCTYPE.
This seems extremely tacky, because it disregards all the other fun
stuff in

(I suspect REXML with 1.8 did not have this issue.)

If I should call'nbsp', ' '), I don't understand how to .add
that before the call to .new, and I don't understand how to easily add
HTML content to a preexisting Document object.

Any tips?
This topic is locked and can not be replied to.