sstrigler / JSJaC

JavaScript Jabber Client Library
Other
295 stars 86 forks source link

Malformed XML generated by XMLSerializer in IE9 #6

Closed sstrigler closed 12 years ago

sstrigler commented 13 years ago

When generating presence XML packets using JSJaCPacket, through JSJaCPresence, the XML generated by JSJaCPacket.prototype.xml is malformed if generated in IE9. For some reason, probably browser-implementation driven, many of the XML nodes in the string format contain an extra empty attribute (xmlns=""). The implementation of ejabberd I'm using interprets these extra empty attributes as invalid and returns a 400 response code and an empty body, which indicates malformed request and response. I've been able to get around this with a hack by ding string replace on this empty attribute when it shows up, but this is obviously not a good long term solution. I have an example below of the XML requests.

Malformed XML: onon

Expected XML: onon<x xmlns="http://jabber.org/protocol/muc