source: git/modules/openmathserver/xmlencodetest.py @ bfcf68

spielwiese
Last change on this file since bfcf68 was bfcf68, checked in by Michael Brickenstein <bricken@…>, 19 years ago
*bricken: can do this all day git-svn-id: file:///usr/local/Singular/svn/trunk@8362 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 870 bytes
Line 
1from objects import *
2from context import *
3import arith1
4context=Context()
5context.push({})
6i=OMint(22482489)
7#print i.body
8print i.XMLencode(context)
9print context.XMLEncodeObject(i)
10v=OMvar("x")
11print v.XMLencode(context)
12x=v
13y=OMvar("y")
14a=OMapplication(OMsymbol("plus",arith1.content),[x,y,i])
15print a.XMLencode(context)
16print context.XMLEncodeObject(context.evaluate(a))
17a1=OMapplication(OMsymbol("plus",arith1.content),[OMint(1),OMint(2)])
18a2=OMapplication(OMsymbol("plus",arith1.content),[a1,OMint(2)])
19a3=OMapplication(OMsymbol("plus",arith1.content),[a2,x])
20context.addCDImplementation(arith1.implementation)
21print "a3", context.XMLEncodeObject(context.evaluate(a3))
22print "a2", context.XMLEncodeObject(context.evaluate(a2))
23print "a1", context.XMLEncodeObject(context.evaluate(a1))
24
25f=OMfloat(1.23434)
26print context.XMLEncodeObject(f)
27#print v.XMLattributes
28
Note: See TracBrowser for help on using the repository browser.