xmlrpc::decode_value (private)
xmlrpc::decode_value node
Defined in packages/xml-rpc/tcl/xml-rpc-procs.tcl
Unpack the data in a value element. Most value elements will have a subnode describing the datatype (e.g. <string> or <int>). If no subnode is present, then we should assume the value is a string.
- Parameters:
- node (required)
- <value> node that we're decoding
- Returns:
- Returns the contents of the <value> node. If the value is a <struct> then returns the data in a TCL array. If the value is an <array> then returns the data in a TCL list.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- xml_rpc_fault, xml_rpc_decode_value, xml_rpc_respond
Source code: set result "" if {[llength [xml_node_get_children $node]]} { # subnode is specified set subnode [xml_node_get_first_child $node] set datatype [xml_node_get_name $subnode] switch -- $datatype { string - i4 - int - double - base64 { set result [xml_node_get_content $subnode] } boolean { set result [string is true [xml_node_get_content $subnode]] } dateTime.iso8601 { set result [clock scan [string trimright [xml_node_get_content $subnode] Z]] } struct { foreach member [xml_node_get_children_by_name $subnode member] { lappend result [xml_node_get_content [xml_node_get_children_by_name $member name]] lappend result [xmlrpc::decode_value [xml_node_get_children_by_name $member value]] } } array { foreach entry [xml_node_get_children [xml_node_get_children_by_name $subnode data]] { lappend result [xmlrpc::decode_value $entry] } } default { # we received a tag which is not a recognized datatype. ns_log notice xmlrpc::decode_value ignored type: $datatype } } } else { # no datatype subnode, therefore, it's a string set result [xml_node_get_content $node] } return $resultXQL Not present: Generic, PostgreSQL, Oracle