Forum: Ruby on Rails AJAX and non-xml entities

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6b2debc2449a8e64b116677464a6442b?d=identicon&s=25 reuben.m@gmail.com (Guest)
on 2007-04-10 23:20
(Received via mailing list)
Recently I made some changes so that I am serving up XHTML 1.1. I'm
talking about real XHTML where the mime type is changed to application/
xhtml+xml and firefox raises hell when there are errors rather then
trying to work around it.

I have a page that uses AJAX to update a div in the page, and I ran
into a problem that I didn't have when serving using the text/html
mime type. The content that was passed back from the AJAX request
contained the "nbsp" html entity and firefox raised an error saying
that "nbsp" is not a valid xml entity.

So my question is how many other html entities are not valid when
passed as xml, and how do I properly send AJAXed content that contains
any such entity?
6b2debc2449a8e64b116677464a6442b?d=identicon&s=25 reuben.m@gmail.com (Guest)
on 2007-04-10 23:30
(Received via mailing list)
I forgot to ask, is there anyway have the server include a dtd or
xmlns tag within the xml response to AJAX requests so that this
doesn't cause problems? If not, shouldn't rails be automatically
converting entities like this to something that is xml compatable like
"& # 1 6 0 ;"
Ec5a599777854c540fd102ef4691fe10?d=identicon&s=25 Rimantas Liubertas (Guest)
on 2007-04-10 23:55
(Received via mailing list)
2007/4/11, reuben.m@gmail.com <reuben.m@gmail.com>:

<...> So my question is how many other html entities are not valid when
> passed as xml, and how do I properly send AJAXed content that contains
> any such entity?

I will not count how many are not valid, but only these firve are safe:
&amp; &apos; &lt; &gt; &quot;


Regards,
Rimantas
--
http://rimantas.com/
This topic is locked and can not be replied to.