util::json2dict (public)

 util::json2dict jsonText

Defined in packages/acs-tcl/tcl/json-procs.tcl

Parse JSON text into a Tcl dict. This function is NOT based on the functions from the "util::json::" namespace, and is built on top of tDOM. It is a replacement for the "json::json2dict" in the tcllib package "json", but is on sample documents several times faster.

Parameters:
jsonText (required)
JSON text
Returns:
dict containing the JSON objects represented by jsonText
Author:
Gustaf Neumann

Testcases:
json_to_dict
Source code:
    #ns_log notice "PARSE\n$jsonText"
    set doc [dom parse -json -- $jsonText]
    set result [expr {[::acs::icanuse "domDoc asTclValue"]
                      ? [$doc asTclValue]
                      : [util::tdomDoc2dict $doc]}]
    $doc delete
    return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: