Some more improvements in the marshall/unmarshall methods.
This commit is contained in:
parent
599396a838
commit
741f760bb5
|
@ -79,4 +79,18 @@ class PodError(Exception):
|
|||
buffer.write('</%s>' % subTag.elem)
|
||||
buffer.write('</%s>' % withinElement.OD.elem)
|
||||
dump = staticmethod(dump)
|
||||
|
||||
def convertToXhtml(s):
|
||||
'''Produces the XHTML-friendly version of p_s.'''
|
||||
res = ''
|
||||
for c in s:
|
||||
if XML_SPECIAL_CHARS.has_key(c):
|
||||
res += XML_SPECIAL_CHARS[c]
|
||||
elif c == '\n':
|
||||
res += '<br/>'
|
||||
elif c == '\r':
|
||||
pass
|
||||
else:
|
||||
res += c
|
||||
return res
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -307,9 +307,9 @@ class XmlMarshaller:
|
|||
if value:
|
||||
if type(value) in self.sequenceTypes:
|
||||
for elem in value:
|
||||
self.dumpField(res, 'url', elem.absolute_url_path())
|
||||
self.dumpField(res, 'url', elem.absolute_url())
|
||||
else:
|
||||
self.dumpField(res, 'url', value.absolute_url_path())
|
||||
self.dumpField(res, 'url', value.absolute_url())
|
||||
elif type(value) in self.sequenceTypes:
|
||||
# The previous condition must be checked before this one because
|
||||
# Referred objects may be stored in lists or tuples, too.
|
||||
|
|
Loading…
Reference in a new issue