Is it possible to insert HTML content in XML document?
You can include HTML content. One possibility is encoding it in BASE64 as you have mentioned.
Another might be using CDATA
tags.
Example using CDATA
:
<xml> <title>Your HTML title</title> <htmlData><![CDATA[<html> <head> <script/> </head> <body> Your HTML's body </body> </html> ]]> </htmlData></xml>
Please note:
CDATA's opening character sequence: <![CDATA[
CDATA's closing character sequence: ]]>
The purpose of BASE64 encoding is to take binary data and be able to persist that to a string. That benefit comes at a cost, an increase in the size of the result (I think it's a 4 to 3 ratio). There are two solutions. If you know the data will be well formed XML, include it directly. The other, an better option, is to include the HTML in a CDATA section within an element within the XML.