MCPcopy Create free account
hub / github.com/Singular/Singular / XMLEncodeObject

Method XMLEncodeObject

Singular/dyn_modules/openmath/context.py:110–125  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

108 def XMLEncodeBody(self,body):
109 return self.XMLEncoder.encode(body)
110 def XMLEncodeObject(self, obj):
111 #TODO: Make Attribution List attributes
112 #TODO: Make all objects __hash__ and __eq__
113 out=StringIO.StringIO()
114 G=XMLGenerator(out)
115 obj.XMLSAXEncode(self,G)
116 return out.getvalue()
117 if (len(obj.attributes)==0):
118 return "".join(obj.XMLPreEncode(self))
119 else:
120 toencode=copy(obj)
121 toencode.attributes={}
122 #FIXME: look on order
123 attribution=OMAttribution(*([OMAttributePair(k,obj.attributes[k])\
124 for k in obj.attributes])+[toencode])
125 return attribution.XMLEncode(self)
126class SimpleErrorHandler(object):
127 def __init__(self):
128 super(SimpleErrorHandler,self).__init__()

Callers 6

xmlencodetest.pyFile · 0.80
XMLEncodeMethod · 0.80
objects.pyFile · 0.80
omxmlreader.pyFile · 0.80

Calls 2

copyFunction · 0.85
XMLEncodeMethod · 0.80

Tested by

no test coverage detected