def exampleEmptyString(): s = """ <value> <struct> <member> <name>blah</name> <value><string/></value> </member> <member> <name>hello</name> <value><string>blah de</string></value> </member> </struct> </value> """ print(xmlrpc.decode(s)[0])
def exampleAmper(): e = xmlrpc.encode('&') print(e) print(xmlrpc.decode(e)[0])
def exampleAscii(): print(xmlrpc.decode('<value><string>&</string></value>'))
def exampleBase64(): b = xmlrpc.base64('Hello, world!') print('base64 is', b) print('encoded base64 is', xmlrpc.encode(b)) print('decoded base64 is', xmlrpc.decode(xmlrpc.encode(b)))
def exampleDate(): d = xmlrpc.dateTime(1999, 6, 12, 4, 32, 34) print('date is', d) print('encoded date is', xmlrpc.encode(d)) print('decoded date is', xmlrpc.decode(xmlrpc.encode(d)))
def exampleEncode(): r = ['hum', 3242, 'de'] print('object is', r) print('encoded is:\n', xmlrpc.encode(r)) print('decoded is:', xmlrpc.decode(xmlrpc.encode(r)))