-/**
- * Generate XML representing the given value.
- *
- * @param $xmlrpc_value
- * @return
- * XML representation of value.
- */
-function xmlrpc_value_get_xml($xmlrpc_value) {
- switch ($xmlrpc_value->type) {
- case 'boolean':
- return '<boolean>'. (($xmlrpc_value->data) ? '1' : '0') .'</boolean>';
- break;
- case 'int':
- return '<int>'. $xmlrpc_value->data .'</int>';
- break;
- case 'double':
- return '<double>'. $xmlrpc_value->data .'</double>';
- break;
- case 'string':
- // Note: we don't escape apostrophes because of the many blogging clients
- // that don't support numerical entities (and XML in general) properly.
- return '<string>'. htmlspecialchars($xmlrpc_value->data) .'</string>';
- break;
- case 'array':
- $return = '<array><data>'."\n";
- foreach ($xmlrpc_value->data as $item) {
- $return .= ' <value>'. $this->xmlrpc_value_get_xml($item) ."</value>\n";
- }
- $return .= '</data></array>';
- return $return;
- break;
- case 'struct':
- $return = '<struct>'."\n";
- foreach ($xmlrpc_value->data as $name => $value) {
- $return .= " <member><name>". htmlentities($name) ."</name><value>";
- $return .= $this->xmlrpc_value_get_xml($value) ."</value></member>\n";
- }
- $return .= '</struct>';
- return $return;
- break;
- case 'date':
- return $this->xmlrpc_date_get_xml($xmlrpc_value->data);
- break;
- case 'base64':
- return $this->xmlrpc_base64_get_xml($xmlrpc_value->data);
- break;
- }
- return FALSE;
-}
+ /**
+ * Generate XML representing the given value.
+ *
+ * @param $xmlrpc_value
+ * @return
+ * XML representation of value.
+ */
+ function xmlrpc_value_get_xml($xmlrpc_value) {
+ switch ($xmlrpc_value->type) {
+ case 'boolean':
+ return '<boolean>'. (($xmlrpc_value->data) ? '1' : '0') .'</boolean>';
+ break;
+ case 'int':
+ return '<int>'. $xmlrpc_value->data .'</int>';
+ break;
+ case 'double':
+ return '<double>'. $xmlrpc_value->data .'</double>';
+ break;
+ case 'string':
+ // Note: we don't escape apostrophes because of the many blogging clients
+ // that don't support numerical entities (and XML in general) properly.
+ return '<string>'. htmlspecialchars($xmlrpc_value->data) .'</string>';
+ break;
+ case 'array':
+ $return = '<array><data>'."\n";
+ foreach ($xmlrpc_value->data as $item) {
+ $return .= ' <value>'. $this->xmlrpc_value_get_xml($item) ."</value>\n";
+ }
+ $return .= '</data></array>';
+ return $return;
+ break;
+ case 'struct':
+ $return = '<struct>'."\n";
+ foreach ($xmlrpc_value->data as $name => $value) {
+ $return .= " <member><name>". htmlentities($name) ."</name><value>";
+ $return .= $this->xmlrpc_value_get_xml($value) ."</value></member>\n";
+ }
+ $return .= '</struct>';
+ return $return;
+ break;
+ case 'date':
+ return $this->xmlrpc_date_get_xml($xmlrpc_value->data);
+ break;
+ case 'base64':
+ return $this->xmlrpc_base64_get_xml($xmlrpc_value->data);
+ break;
+ }
+ return FALSE;
+ }