Commit d9b63233 authored by Jim Fulton's avatar Jim Fulton

Cosmetic changes to generated XML.

parent 8ecc9da6
...@@ -136,10 +136,10 @@ def convert(S, find=string.find): ...@@ -136,10 +136,10 @@ def convert(S, find=string.find):
new = string.join(map(lambda s: d[s], S), '') new = string.join(map(lambda s: d[s], S), '')
if len(new) > (1.4*len(S)): if len(new) > (1.4*len(S)):
encoding = 'base64' encoding = 'base64'
new = base64.encodestring(S) new = base64.encodestring(S)[:-1]
elif find(new,'>') >= 0 or find(new,'<') >= 0 or find(new,'&') >= 0: elif find(new,'>') >= 0 or find(new,'<') >= 0 or find(new,'&') >= 0:
if find(new, ']]>') <0 : if find(new, ']]>') <0 :
new='<![CDATA[\012'+new+'\012]]>' new='<![CDATA[\n\n'+new+'\n\n]]>'
encoding='cdata' encoding='cdata'
else: else:
new=string.join(map(lambda s: d2[s], new), '') new=string.join(map(lambda s: d2[s], new), '')
......
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