Commit dd8f86d0 authored by Aurel's avatar Aurel

if we do not get syncml, it must be CDATA type

parent 91c808a0
......@@ -579,9 +579,14 @@ class SyncMLRequest(object):
sync_command_kw["xml_data"] = etree.tostring(xml_data[0])
else:
# If not xml, return raw data
# XXX This must be CDATA type
data = sync_command.xpath('string(.//syncml:Item/syncml:Data)',
namespaces=self.data.nsmap)
if isinstance(data, etree.CDATA):
parser = etree.XMLParser(strip_cdata=False)
cdata = etree.XML(data, parser)
data = cdata.text
# XXX this is unicode and can be a problem for activity
sync_command_kw["raw_data"] = sync_command.xpath(
'string(.//syncml:Item/syncml:Data)',
namespaces=self.data.nsmap)
sync_command_kw["raw_data"] = data
append(sync_command_kw)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment