After upgrading to smack 4 (specifically 4.1.2), we noticed that some incoming XHTML messages are failing XHTML 1.0 validation. It seems that the parsing has changed with version 4. In XHTMLExtensionProvider the body is populated using the output parsed from the XmlPullParser. The pull parser, MXParser.parseEntityRef() method, is unescaping sequences like:
& < > ' " etc...
So if smack receives a message like this:
<body>Sending restricted XHTML char &</body>
The body that smack provides in the parsed XHTMLExtension will be:
<p>Sending restricted XHTML char &</p>
Which is not compliant XHTML.
Is there a way to force the pull parser to preserve the XML escaped character sequences within the XHTML body?