Issue
I need to XHTML encode some text in Android.
I had been using Html.escapeHtml().
However Html.escapeHtml(" ") generates " ". I need it to generate "  ".
Is there an equivalent? I need like a Xhtml.escapeXhtml().
Or should I just do string replacements?
Solution
Ah, I just realized the problem is that the document is missing the DTD. I need to add
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
to the top of the document
and then is valid.
Similar answer here: Undefined entity   XML parsing exception
Answered By - Kirby
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.