def cdata_custom(): """Confirm custom cdata modifiations escape all characters except opening and closing cdata tags. """ xml = '<![CDATA[<u><b>underline and bold</u></b>]]>' e = Encoder() d = e.encode(xml) encoded_xml = '<![CDATA[<u><b>underline and bold</u></b>]]>' assert d == encoded_xml
B{far} better. XML namespaces in suds are represented using a (2) element tuple containing the prefix and the URI. Eg: I{('tns', 'http://myns')} @var encoder: A I{pluggable} XML special character processor used to encode/decode strings. @type encoder: L{Encoder} """ from suds.sax.enc import Encoder # # pluggable XML special character encoder. # encoder = Encoder() def splitPrefix(name): """ Split the name into a tuple (I{prefix}, I{name}). The first element in the tuple is I{None} when the name does't have a prefix. @param name: A node name containing an optional prefix. @type name: basestring @return: A tuple containing the (2) parts of I{name} @rtype: (I{prefix}, I{name}) """ if isinstance(name, basestring) \ and ':' in name: return tuple(name.split(':', 1)) else: