PYTHON xmlrpc_decode

is this article helpful?
|
Python replacement for PHP's xmlrpc_decode [ edit | history ]
import xmlrpclib


xml_in = """<?xml version="1.0" encoding="utf-8"?>
<params>
<param>
<value>
<struct>
<member>
<name>param1</name>
<value>
<string>value1</string>
</value>
</member>
<member>
<name>param2</name>
<value>
<string>value2</string>
</value>
</member>
</struct>
</value>
</param>
</params>"""

data = xmlrpclib.loads(xml_in)

PHP xmlrpc_decode

PHP original manual for xmlrpc_decode [ show | php.net ]

xmlrpc_decode

(PHP 4 >= 4.1.0, PHP 5)

xmlrpc_decodeDecodes XML into native PHP types

Description

mixed xmlrpc_decode ( string $xml [, string $encoding ] )
Warning

This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk.

Parameters

xml

XML response returned by XMLRPC method.

encoding

Input encoding supported by iconv (defaults to "iso-8859-1").

Return Values

Returns either an array, or an integer, or a string, or a boolean according to the response returned by the XMLRPC method.

Examples

See example by xmlrpc_encode_request().

See Also