必需的参数
- handle: 对 JSON 数据的可读句柄引用。
示例
以下示例使用 jsonOpen 为某些静态 JSON 文本创建句柄,然后将该句柄传递给另一个运算器(在本例中,第二个运算器是 jsonDOMGet)。 然后它使用 jsonClose 关闭 jsonOpen 创建的句柄。请确保在使用 jsonOpen 时使用 jsonClose 运算器,以避免通过打开句柄泄漏内存。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
关闭由 jsonOpen 创建的 JSON 句柄,以释放打开的资源。
<!-- Setting some static JSON text -->
<arc:set attr="json.text" value='{"hello": "world","settings": {"foo": "bar"}}' />
<arc:call op="jsonOpen" in="json" out="output" >
<!-- Setting the json handle as an attribute on a new item that is passed into a second operation -->
<arc:set attr="json2.handle" value="[output.handle]" />
<arc:set attr="json2.map:value1" value="/json/settings/foo" />
<arc:call op="jsonDOMGet" in="json2" out="output2" >
<!-- Here is where you can execute additional script for the operation that is using the handle -->
</arc:call>
<!-- Using the arc:finally keyword to execute the closing of the handle last -->
<arc:finally>
<!-- Calling jsonClose to close the handle created by jsonOpen -->
<arc:call op="jsonClose" in="json2" />
</arc:finally>
</arc:call>