Changeset bfcf68 in git for modules/openmathserver/xmlencodetest.py
- Timestamp:
- Jun 14, 2005, 2:22:52 PM (18 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 9b973c144b1c3a7ddd2df88833b75055fc1688ae
- Parents:
- bb3e2b01b8b571e1ce0e1df85bcb71fb0ccb8e9d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/openmathserver/xmlencodetest.py
rbb3e2b0 rbfcf68 1 1 from objects import * 2 2 from context import * 3 import arith1 3 4 context=Context() 4 5 context.push({}) 5 6 i=OMint(22482489) 6 print i.body7 #print i.body 7 8 print i.XMLencode(context) 9 print context.XMLEncodeObject(i) 8 10 v=OMvar("x") 9 11 print v.XMLencode(context) 10 print v.XMLattributes 12 x=v 13 y=OMvar("y") 14 a=OMapplication(OMsymbol("plus",arith1.content),[x,y,i]) 15 print a.XMLencode(context) 16 print context.XMLEncodeObject(context.evaluate(a)) 17 a1=OMapplication(OMsymbol("plus",arith1.content),[OMint(1),OMint(2)]) 18 a2=OMapplication(OMsymbol("plus",arith1.content),[a1,OMint(2)]) 19 a3=OMapplication(OMsymbol("plus",arith1.content),[a2,x]) 20 context.addCDImplementation(arith1.implementation) 21 print "a3", context.XMLEncodeObject(context.evaluate(a3)) 22 print "a2", context.XMLEncodeObject(context.evaluate(a2)) 23 print "a1", context.XMLEncodeObject(context.evaluate(a1)) 24 25 f=OMfloat(1.23434) 26 print context.XMLEncodeObject(f) 27 #print v.XMLattributes 28
Note: See TracChangeset
for help on using the changeset viewer.